hericles 289 Master Poster Featured Poster

Where are you specifying your connection information? Is this all of the relevant code?

hericles 289 Master Poster Featured Poster

Post up your code and we'll have a look. Its hard to fix someone's problem when you can't see what could be causing it...

hericles 289 Master Poster Featured Poster

If you simply want to validate the input, make sure values are entered in required fields, that emails are in email format, etc you can just use jQuery to monitor each input for changes and validate them.
If you need to check the input against a database for any reason then you need AJAX to post the query away and get a response without leaving the page.
Both of those methods happen as the user enters data into the page and have nothing to do with the form submission (in fact, once anything is flagged as bad or a required field is incomplete you could disable the button).
Recording the info and sending an email would be handled by the PHP script on form submission.

I doubt you will find a custom script that works exactly as you want and PHP scripts won't work the way you want anyway as they require post back.

diafol commented: good points +14
hericles 289 Master Poster Featured Poster

I'm not sure what you mean when you say 'Class Form'. Are you referring to the form class? E.g. the class used to create Forms in winForms programs?

A class diagram is a text/graphical display of a class, outlining various aspects of its structure such as name, parameter types, included methods, etc.
Diagrams incorporating several classes are uses to show how software components fit together and interact.
A picture would explain it better. google images for class diagram and you'll find plenty of simple examples.

hericles 289 Master Poster Featured Poster

Java does an automatic compilation process where any dependent classes it finds referred to within the class it is compiling are compiled too.
This is nested so if your Vehicle class referred to another class, the .java of which was in the same directory, it would also be compiled when you typed
javac VehicleDemo.java

hericles 289 Master Poster Featured Poster

I have no experience with Pycharm so I can't help with that. IDLE was OK but when I started using Python I was already used to eclipse so using eclipse with the python mod was an obvious choice.
Eclipse is almost certainly the IDE you will want to move to eventually.

hericles 289 Master Poster Featured Poster

CONCAT_WS stands for concatenate with separator. It takes three parameters, the seperator, string1 and string 2. So in your case you told CONCAT_WS that "$dstart' is the separator rather than a value to concat. So either use
CONCAT_WS(' ', '$dstart', '$tstart') to separate by a space or just use CONCAT.

hericles 289 Master Poster Featured Poster

One will be for mic, the other for sound. The single plug on your computer will be for headphones (vs head set). How old is the computer and have you plugged a mike into it before?

hericles 289 Master Poster Featured Poster

What the hell was that? I don't get it...

hericles 289 Master Poster Featured Poster

Given that an int can hold a maximum value of 2,147,483,647 the maximum number that could be entered is 12 as 13 gives an overflow. Your example uses long so maybe you should be using that too.

I'm not a mathmatician but I'm not sure what your instructor's check code would achieve. A times B is not the same as A!.

hericles 289 Master Poster Featured Poster

That is correct. PRIMARY KEY (column1, column2...) will create a primary key using the columns specified.

hericles 289 Master Poster Featured Poster

Are you using jquery? If you were it would be as easy as
$('#parent .1')

hericles 289 Master Poster Featured Poster

If the code runs when it is inline but not when it is separated the <link> must be the problem. Can you confirm the file name, bground.css, is correct.
The only think left must be a simple mistake.

hericles 289 Master Poster Featured Poster

You only create one Supplies object and then proceed to make it equal to product1, then product2, then product3, etc. At no time in your code do you have two Supplies objects in existence, you just keep resetting the one.
This is why item 7 works, it is the only one that survives your set up.

You probably need a loop that creates items 1 (through to 7), outputs its values then loops around creating the next item up - although this depends on what exactly it is you need to achieve.
Does that make sense?

hericles 289 Master Poster Featured Poster

In your code smaple you have the start of the FOR loop but I can't see where it ends. Is you final echo ouside of the FOR loop? If it is then you should only see one echo which should, hopefully, be the total.

hericles 289 Master Poster Featured Poster

OK, I see now. In that case define $resultMax and $resultMin before the FOR loop, so they aren't reset/overwritten on subsequent loops, and use the if/else to tally up totals
$resultMax = $resultMax + ($vl_max x $pares);

That will give you a running total of $resultMax and $resultMin that can then be tallied at the end. I only just saw the FOR loop now.

hericles 289 Master Poster Featured Poster

Sorry, I may not be understanding exactly what you need then. In your initial post you said you needed to get 105.29, the sum of 55.14 & 50.15 (the max and min calculation I'm assuming).
But if you're getting just one value OR the other then you never have two values to total... So what am I missing?

hericles 289 Master Poster Featured Poster

You still have the if/else clause in there.
If $id_marca != 1 the resultMax is calculated otherwise it is 0.
If $id_marca = 1 then resultMin is calculated otherwise it is 0;

Take out that entire if/else block and just have the two calcualtion lines. Then $resultMax and $resultMin will both hold values and $result will be the sum of them both and not just one of them + 0;

hericles 289 Master Poster Featured Poster

If you want both values totalled then you don't want the IF/ELSE structure because that is the reason only one calculation is running (whether $id_marca equals 1 or not).
Depending on your exact requirements you would be better off to store each calculation into two different result variables and then add them.

$resultMax = $vl_max*$pares; // id_marca = 22 [ 38 pares * 1.451 = 55.14 ]
$resultMin = $vl_min*$pares; ///id_marca = 1  [ 36 pares * 1.392 = 50.15 ]

$result = $resultMax + $resultMin;
hericles 289 Master Poster Featured Poster

What you need is going to vary a lot depending on the host and how they implement their control panel. They may not even have a control panel and everything could be done via SSH or similar.
The best place to start would the free host itself. Do they have docs, examples, help support that can assist you?

hericles 289 Master Poster Featured Poster

You have only added 10 elements to the array dblMarks but you are stepping up to 11 in your loop. No position 11 exists in the array.

hericles 289 Master Poster Featured Poster

I have a fairly big library and I still like reading paper books but I have found recently that the ease of availability of e-books, and how many you can carry at once, is just too convenient. I like paper books for fiction, e-books for reference and learning.

hericles 289 Master Poster Featured Poster

What exactly is going wrong? Can you not pass the order id to the stored procedure or is the stored procedure failing? Your screen shots indicate that selecting an order ID returns the order details...

hericles 289 Master Poster Featured Poster

All you have done here in create a new instance of Form1 and then closed that. There is no connection between the Form1 you have open and the new Form1 you created.
You need to pass the reference to Form1 to Form2 when Form2 is created (or at some later point). You can use a property in Form2 to do this.
For example, if both are opened from button clicks in a parent form when the button to create Form2 is clicked the code passes in Form1 to Form2's constructor.
Once you have that reference in Form2 you can call methods on Form1.

hericles 289 Master Poster Featured Poster

You can use as many as you like to get the job done.

hericles 289 Master Poster Featured Poster

Hi,
If I understand your question the combo box will have the id in it (or maybe the user's name only) so you will get the selected item of the combo box and then use that value in the sql query. You can't use parameters for column names (unless I'm out of date, hope i'm not) so you need to build a query string that included the column as text.

Say for example your combo box has the selected value '001' and that is the name of the column in your table you would then do something like this:
string sql = "SELECT " + id + " FROM table WHERE... etc";

If you have something else as the combo values that relates to a user ID in a table then you'll have to do a another query before this one to extract the correct user id.
Note that as you aren't using parameters you will need to be careful about SQL injection. In other words, your column name variable that you add to the query must never be something enterd by the user as text.

Is that what you're after?

hericles 289 Master Poster Featured Poster

Are you asking for help with CSS styling and how to make the form look like that? If yes, place your form in a div (or more than one if that works better) and either use standard CSS properties or load up a background image. Is that the kind of thing you're trying to do?

hericles 289 Master Poster Featured Poster

First thing to do is debug your code and make sure there are values to insert into the combo box after the selection statement has run e.g. check the reader isn't empty.

hericles 289 Master Poster Featured Poster

If you only have the two options that the text can be a simple if statement inside the button click function is the easiest option.
Check if the current text is "Connect" and if so change the text property to "Disconnect" and vice versa.

if(connect.text == "Connect") {
    connect.text = "Disconnect";
} else {
    connect.text = "Connect";
}
daniel955 commented: but check if the connection is successful not the button text. +1
hericles 289 Master Poster Featured Poster

Is it due to the overlapping selection lengths? You have 0 to 7 and 0 to 4 which obviously both include 0-4.

hericles 289 Master Poster Featured Poster

Joins are intensive work for the datatbase to do and each subsequent join in the same query just makes it worse. If the search is a repeated one you could consider creating a view of that data and extracting that instead.
Otherwise look for hints online for optimising both the database and the query.

hericles 289 Master Poster Featured Poster

You can't just bypass a email provider's spam settings by tweaking your email. If you could spam filters would be useless.

hericles 289 Master Poster Featured Poster

google CCS only drop down menu and you will find plenty of examples. Javascript versions work just as well too.

hericles 289 Master Poster Featured Poster

I see what is going on now. I assume you want the div to be clickable and move to the correct URL. But as you have your links now the link is inside the div and contains no text, making the clickable area very small. I would suggest not using background images and placing an image inside the link:

<a href="http://www.google.com">
  <img src="g+_hover.png" />
</a>

You could place the anchor around the div and still use background images but that technically isn't correct HTML so the page won't place validation if you care about that.

hericles 289 Master Poster Featured Poster

Is the path to the images correct in the CSS? As you have it now the images would need to be in the same directory as the CSS file. If you have your images in an images folder and your CSS files in another folder, both in the root directory your CSS would look like this:

background-image: url('../images/g+_hover.png');
hericles 289 Master Poster Featured Poster

You aren't executing the command at all. You're defining it and adding the SQL statement and the connection but you also need to add

cmd.ExecuteNonQuery();

to make the command actually affect the database. I'm assuming you have the opened the connection as well.

hericles 289 Master Poster Featured Poster

You aren't specifying a size for the array. If you know how big it is going to be include the size in the initializing code

Dim clust(5) As bicluster

Or use the redim method to redefine it with a size:

ReDim clust(5)

If you don't know the size of the array use an arrayList instead as they can grow without the performance hit brought on by repeated ReDims.

hericles 289 Master Poster Featured Poster

Again you should check out jquery cycle. Beyond adding the libraries and correctly naming the divs on the page there is one script (a couple of lines) that you need to add to the page to set it all in motion.

hericles 289 Master Poster Featured Poster

How are your ships defined? They should be 3 instances of the one class and presumably kept in an arrya or something similar so looping through each ships turn is easy. To determine which ship is the winner loop through the array looking for the ship object that has hull > 0;

hericles 289 Master Poster Featured Poster

Check out jQuery cycle. It is a jQuery library for slideshows with a variety of transitions. It is pretty easy to set up too.

hericles 289 Master Poster Featured Poster

For the while loop simply put in an integer that holds the number of ships still alive (3,2 or 1). While (shipsAlive >) 1 {} will keep your game looping and you simply decrease the number by one when a ship is destroyed.
For the targets, add variables that indicate which target each ship is targeting then, when B is destroyed, set the A variable to indicate ship C. So, in essence, A isn't attacking ship B then C it is always attacking A_target but that changes during the game. Does that make sense?

hericles 289 Master Poster Featured Poster

In the global.asax file there is a session_end function which is called when the timeout period for the website is reached. You can use that to alter any session variables or to clear them out completely if a user has been inactive.

hericles 289 Master Poster Featured Poster

What are you trying to do here? You seem to be setting textboxes to values retrieved from a database and then immediately redirecting the user to another page. Whats the point in doing that?
If you want to populate that data on another page there your should be doing the data extraction on that page as well.

hericles 289 Master Poster Featured Poster

iStockPhoto was one I used in the past that was definitely free (I think it still is) and I think stock xchng had some free. The range wasn't as large as their paid options and they were of the more stilted variety of photos but you could get decent landscapes, people shots most of the time.

hericles 289 Master Poster Featured Poster

If only there was some kind of machine that could search the world for these kinds of things... oh wait. Did you google "free stock images"?
I did and found:
stock xchng, getty free images, turbo photo, stock vault and a pile of others.
Maybe my sarcasmism is misplaced but, come on, google is your friend.

hericles 289 Master Poster Featured Poster

Try a simple test: add a javascript function to the first textbox so it prompts an alert when clicked. If that alert doesn't come up when you try and click on it then you have something intercepting the clicks on the form.
What does spam.js do?

hericles 289 Master Poster Featured Poster

To make it clearer for us you could have mentioned that the problem is that the textboxes don't get focus so you can't type in them. Tabbing also works to get into the textbox by the way but it still isn't very user friendly.
The code works fine if I paste it into a test page of my own. Is there anything else on the page that would be intercepting the click events of the textboxes? Does adding tabindex="1" to the first textbox help?

hericles 289 Master Poster Featured Poster

You need to alter your filter so it includes multiple statements. I.e. "Brand='Samsung' AND brand = 'Nokia'".
To do this you will need to collate which checkboxes are checked and build up a string that represents that and pass it into your RowFilter.

private void filterView() {
   ArrayList filters = new ArrayList();
   if(Checkbox1.Checked) {
      filters.Add("brand = 'Nokia'");
   }
   if(Checkbox2.Checked) {
      filters.Add("brand = 'Samsung'");
   }
   if(Checkbox3.Checked) {
      filters.Add("brand = 'Blackberry'");
   }
   if(Checkbox4.Checked) {
      filters.Add("brand = 'SonyEricson'");
   }
   string filter = "";
   if(filters.count == 1) {
      filter = filters[0].ToString();
   } else {
      for(int i = 0; i < filters.count-1; i++) {
        filter += filters[i].ToString() + " AND ";
      }
      filter += filters[filters.count - 1].ToString();
   }
   DataView dv = dt.DefaultView;
   dv.RowFilter = filter;
   DataList1.DataSource = dv;
   DataList1.DataBind();
}

Call this function from within every CheckBox_Changed event and it should build up the string correctly. I just typed this on the fly so I'm hoping it will work (it should) but its enough for you to get the idea anyway.

crazydevelopervish commented: thanks +0
hericles 289 Master Poster Featured Poster

Which version of SQL Server are you trying to restore to? If it is of an older version of MS SQL than your source database you will see this error. If in doubt use

SELECT @@VERSION

on both to make sure they are the same.

hericles 289 Master Poster Featured Poster

Move that code out of the form_load event into its own function. You can call that function from form_load to get the data at startup but you will also be able to call the code at anytime to get any new data (via a button that calls that function for example)