hericles 289 Master Poster Featured Poster

Basically, yes. When your browser starts up it will open the file, read the contents and parse the URLs. You can use basic file IO of .net to do that. Check stream readers and the file object online and you'll find plenty of simple tutorials to guide you.

hericles 289 Master Poster Featured Poster

For connecting to a database you need several things. A connection string holds the information relevant to connecting to the database (location, login details, security, etc), a connection object which you open and close to connect to the database and a command object which takes the SQL query and actions it on the database inserting or returning data as appropriate.
There is a very useful site that has all the connection strings you will ever need. I can't remember the name but type 'connection strings' into google and you'll find it.

A basic database section of code might look like this in C#

string connectionStr = // your connection string goes here;
String SQL = "select * from some_table";
oleDbConnection conn = new oleDbConnection(connectionStr);
oleDbCommand cmd = new oleDbCommand(sql, conn);
dataTable dt = cmd.executeScalar();

you can obviously return a range of data types: strings, ints, row sets or entire tables. What you are returning will determine what object you use to catch and handle the returned data.
Thats a basic start anyway. Hope it helps.

hericles 289 Master Poster Featured Poster

It sounds like you want open a file and display it's contents in a text box, make changes to the text and then save it back to the same location. If that is correct, all you need to do in the save bottom is use a stream writer to convert the new text into a stream and save to a file.

hericles 289 Master Poster Featured Poster

That's because you haven't provided for the return of the function in both the try and catch blocks. If a function returns a value or object all code paths must ensure something is returned. Your catch block is probably the culprit.

EDIT: Oops, didn't see there was a page 2... I'm a bit late with this post

hericles 289 Master Poster Featured Poster

The directoryInfo Class allows you examine the contents of folders and sub folders. You can read about how to use it here:
http://msdn.microsoft.com/en-us/library/system.io.directoryinfo(v=vs.71).aspx

hericles 289 Master Poster Featured Poster

You don't technically need one if your project is never going to be used outside your own software. The default one provided will suffice, you don't need to restructure anything. However, providing a namespace is painless and correct but the final choice is up to you.

hericles 289 Master Poster Featured Poster

<script> tags need a closing </script> tag. /> is not enough.

hericles 289 Master Poster Featured Poster

Could it be as simple as including z-index in the CSS of the menu to make it display on top? I'm not familiar with this particular library so I'm guessing here:)

hericles 289 Master Poster Featured Poster

I would have thought this is simply a case of adding code to your exit method (browser shutdown) to save the URLs of all open tabs to either a flat file or small database. On starting the browser read the file and open one tab per entry in the file.

hericles 289 Master Poster Featured Poster

But where are you declaring Name? You can't just have

Name = faultTree.Attribute("Events").Value

without saying what Name is, particularly if Name is in another class. You would need to declare it in the usual way before using it.

hericles 289 Master Poster Featured Poster

This is probably because the auto complete code is being called in the onTextChanged event and simply hitting the arrow key won't cause it to fire again (mainly because the text box doesn't have focus anymore). You can catch in the form's key event rather than that of the text box and call whatever function is called by onTextChanged function.

hericles 289 Master Poster Featured Poster

Reading a tutorial on the net will probably help you more than any explanation you could get here but briefly: in object oriented programming a class allows you separate code into units (classes) for ease of reuse and to keep relevant code functions together.
Say you created a class called Dog. You could then put dog related methods into this class such bark() or dragButtOnFloor(). Then in your calling code you first create an instance of the Dog class and then call it's methods. In c#

Dog dog = new Dog();
dog.bark();

Classes also allow for things like inheritance which is another topic you will want to learn about too.
But, as I said, an online resource or book will provide the depth you need to learn these concepts.

hericles 289 Master Poster Featured Poster

Can't you just call the auto complete code again? The last text entered is still in the text box at this point? It would just be a matter of detecting the enter key press and calling the function.

hericles 289 Master Poster Featured Poster

Is inputLength the length of the inputs array? Because I don't see how the two arrays would be of the same length. If I wanted to subtract 3 from 15 I'd have 2 numbers in the input array and only one in the operators array (the - sign). Yet you loop through them both at the same rate.
Is input1 not in the input array?
To be honest I can't see why the arrays are needed, most calculators perform the operation on the 2 inputs, storing the result awaiting the next operator.

hericles 289 Master Poster Featured Poster

You can code up some simple validation by using javascript's document.getElementById function. Call a method in the on click of your submit button or the onSubmit method of the form and then use the getEelementById to locate each control you want to validate. Do you want to simply check the text boxes have something entered in them or check for bad data at the same time?

A really simple function to check if the user name is filled in would look like this:

function validate{
  var userControl = document.getElementById(txtUser);
  if(userControl.value.length < 1) {
    // handle the error
   return false;
  }
}

Your form will have this included: onSubmit="return validate();" you can then return true to post the form or false to cancel i.e. stay on the same page and handle the errors.

hericles 289 Master Poster Featured Poster

Fortune favors the prepared mind

May the best of your past be the worst of your future

It was like that when I got here!

hericles 289 Master Poster Featured Poster

Put break point in your onPaint method and run in debug, just to make sure the method is being called correctly.

hericles 289 Master Poster Featured Poster

Kavi4u, you do know this functionality is provided by tab (forward) and shift-tab (back) right? How are going to handle a user wanting to move the cursor back inside the current text box to correct a typo?

hericles 289 Master Poster Featured Poster

You're going to have to doctor that query script a lot to make it fit your form - the two don't have that much in common. Do you know query? If not it may not be worth your time. Depending on the validation you need to do there are less complex ways of checking the input with javascript.

hericles 289 Master Poster Featured Poster

Well, for a start, what do you mean by 'not working'? Do you get an error message, is some functionality OK but not all of it or does it simply do nothing at all?

hericles 289 Master Poster Featured Poster

Are you returning just one record from the database or a dataset?
If one record you can place it into the text area using its .Text method (your text area is marked as runat="server" right?). E.g. textArea.Text = dataString;

assuming you returned a string from the database a sample might look like this:

string data = command.ExecuteScalar().ToString();
textArea.Text = data // you can of course do this in one line if you prefer

Returning a dataset is a little bit harder as you need to loop through the rows and concatenate them together for display in the text box.

hericles 289 Master Poster Featured Poster

This doesn't belong in this forum, there are other places it should have been posted. And, to my shame, I even tried to check it out only to find I can't. Check it out where?????

hericles 289 Master Poster Featured Poster

Sorry, I meant Tuition is of type string in my post above, not int obviously.

hericles 289 Master Poster Featured Poster

No, cast the executeScalar command as it returns an object which you then try to jam in to Tuition. tuition is of type int right? Casting Tuition after it has incorrectly stored the executeScalar won't fix the issue.

hericles 289 Master Poster Featured Poster

I don't think you got the table details right. How you can insert phone number and duration into a table that holds user ID and password?

hericles 289 Master Poster Featured Poster

Well you could have this for the last part of the SQL:
WHERE (@listItem LIKE '%' + @CUST_NAME + '%')"

and use parameters for the @listItem as you have for @CUST_NAME.

As for the error, your SQL string will have a mistake in it. Looking at what I typed it maybe the quotes marks around the % are the problem. Try
WHERE " + dropDownList.selectedItem.ToString() + " LIKE %' + @CUST_NAME + '%"

hericles 289 Master Poster Featured Poster

If you intend to have the dropdown box have the various categories such as name, address, date and then a textbox that takes the actual search time all you need to do is include the selected item from the dropdown into the sql query along with the search term.
E.g. imagine I selected name in the list and entered a name as the search term in the textbox.

"SELECT [ROUTE], [INST_KEY], [INST_TYPE], [ACCT_KEY], [STATUS],
    [DMZ], [CUST_NAME], [ADDRESS_LINE1], [ADDRESS_LINE3], [ADDRESS_LINE4], [ADDRESS_LINE5],
    [METER_KEY], [SIZE], [INSTALL_DATE], [X], [Y], [Z], [ADDRESS_LINE2], [MI_PRINX] FROM [DBCUSTOMER]
    WHERE (" + dropDownList.selectedItem.ToString() + " LIKE '%' + @CUST_NAME + '%')"

Obviously the list can be added as a parameter as cust_name is.

hericles 289 Master Poster Featured Poster

You need to cast the returned object from executeScalar. Use the toString() method and it should work OK.

hericles 289 Master Poster Featured Poster

Thats a really big topic unfortunately. Seeing you already know how to code desktop software it won't be too big a leap however. Do you know HTML and CSS?
Create a web project in visual studio and for each web page you'll see two files, the .aspx (which is the visual aspects of the webpage where you code your HTML) and a .aspx.vb file (which is sometimes called code behind). The aspx.vb contains all of your server code.
I would suggest having a play. Open a project, go to the designer view of the .aspx page and drag controls onto the page. Double click them to create method stubs in the code behind. This will show you how to relate controls on the webpage to the code that does the actual functionality.
Online tutorials will help a lot too.

hericles 289 Master Poster Featured Poster

I think he means include the database in the installer. Right, is that what you mean?
If yes, then this article is what you need
http://msdn.microsoft.com/en-us/library/49b92ztk.aspx

hericles 289 Master Poster Featured Poster

You need to read and understand the concepts here: http://msdn.microsoft.com/en-us/library/wkzf914z%28v=vs.71%29.aspx

This explains events and how they are raised.

hericles 289 Master Poster Featured Poster

Way more information needed...
What do you mean by edit your program? Are you entering or updating information?
It is most likely your code connecting to the database if the error is related to changing data.
Do you get any error messages?

hericles 289 Master Poster Featured Poster

OK, firstly, does the program need to save the entered data each time or does the user simply enter all past fuels fills at the one time to get the average? The answer to this question determines whether you need to use a file to save the information.

The algorithms are fairly simple. For each fuel fill it is kms done / number of litres of fuel to give kms per litre. Overall distance is the same but including all of the data.

hericles 289 Master Poster Featured Poster

Are you trying to make a row cell of a different width to rows above or below? You would need to either place a new table inside your table row (which gets messy very quickly) or you could increase the number of columns in your table and use the colspan attribute to dictate how many columns each cell takes up.

<tr>
  <td colspan="2"></td>
</tr>
<tr>
  <td colspan="1"></td>
</tr>

Here the first td will be twice as long as the one below. This will leave gaps and possibly make your table look pretty uneven though.

hericles 289 Master Poster Featured Poster

Where is the database residing? Is it externally hosted or within your network? And is the website internal or external to your network?

hericles 289 Master Poster Featured Poster

For a start I'm knot sure how you are going to insert into the database table with only one text box - I'm assuming you need to be able to add an author and book to the database.
You already have a database connection done so the only thing left is looking into how to UPDATE, INSERT and DELETE in a database.
I'm not going to provide you with code (it sounds a lot like a uni assignment to me) but for the insertion for example, you need to connect to the database and then add the data you want to insert into your SQL query:
INSERT INTO table_name VALUES(value1, value2, value3, etc)

Then execute the command and you should be done. You will find plenty of tutorials that explain ado.net and SQL online. Once you have had a crack at it and got some actual code to post up we can give more specific advice.

hericles 289 Master Poster Featured Poster

OK, somewhere your Cost value must be getting dumped. Is it coming up zero for all destination and delivery types?
Step through your code in debug mode and check the Cost variable is ever showing anything other than 0.00.

hericles 289 Master Poster Featured Poster

The database file can be placed anywhere (the data folder of the SQL Server install is the default) but you need a copy of SQL server on the computer to be able to use the file. As I said before, without an actual SQL server available the SQL file is useless. Its the same as trying to open a .xls file without a spreadsheet application - it doesn't work.

hericles 289 Master Poster Featured Poster

Try this string.format style instead:

String.Format("{0:c}", Cost) will return $10.00. The $ is replaced by whatever symbol is specified by the locale setting.
If you need it to be pounds regardless try
Me.lblCost.Text = "" + String.Format("{0:n2}", Cost) which will give you a number to 2 decimal places with your currency symbol placed in front.

hericles 289 Master Poster Featured Poster

This code doesn't include the original line you posted about: this.tableLayoutPanel1.ResumeLayout(false);

So where does that fit into it?

hericles 289 Master Poster Featured Poster

Considering each table has a different range of columns and data types a stored procedure for each is probably required. If you could use the same insert procedure to insert the same data into several tables that begs the question of why you have these others tables in the first place.

hericles 289 Master Poster Featured Poster

No, you will need an instance of sql server installed on the machine that accesses the sql database file. Placing a database file in your app_data won't do anything as nothing on the computer will be able to read it - its like trying to play a movie file without the correct codec.
You can always install a copy of SQl Express (which is free) or SQLlite with your application.

hericles 289 Master Poster Featured Poster

before loading the data into the listbox you need to call the .Clear() method on the listbox. This will remove the current data from the listbox. Without that it just appends the new data to what is already in there.

hericles 289 Master Poster Featured Poster

If you simply want the text to be in uppercase after it is loaded or type use .ToUpper() on the entire string.

If you want the user input to appear uppercase as they type, in the text box.OnTextChanged event get the last character typed, which will be the last character of the text in the text box, and use .ToUpper() on it then concatenate it back onto the rest.

hericles 289 Master Poster Featured Poster

You say you have 5 errors but you don't tell us what they are...
You set the Prompt string within each button function and then place it in each element of the array - I'm not sure why.

Prompt = "Please enter grade scores one at a time";
for (i = 0; i <= Tests1.Length; i++)
            {
                Tests1[i] = Convert.ToInt16(Prompt.ToString);
                Total1 = Total1 + Tests1[i];
                textBox1.Text = Convert.ToString((Total1) / NumTest1);
                if (string.IsNullOrEmpty(textBox1.Text))
                {
                    textBox1.Text = "0";
                }
            }

problem one is this: Tests1 = Convert.ToInt16(Prompt.ToString); - This is should be ToString();
You're trying to convert a string ("Please enter grade scores one at a time") to an integer.
That won't work.

From a readability perspective you've capitalised all of your variables which is normally reserved for classes. Variables conventionally begin with a lowercase letter.

Post up your errors, explain why you need to convert the prompt string to an int and we'll see if we can help you more.

Griff0527 commented: Direct answer that made me think for myself to find one of my many errors, leading me to further investigate the rest. This poster does not give the "easy" answer, but instead expects you to LEARN from your mistakes. +2
hericles 289 Master Poster Featured Poster

We're going to need a bit more information than that to help you. Have you done any code? What conflicts are you referring to? you make it sound as if it is already automated therefore done... What exactly are you trying to achieve?

hericles 289 Master Poster Featured Poster

When you say zoom do you mean display a larger image? Or do you want the image in zoom in through a range of ratios? Because a mouse over is either over the image or not. You'd have no control of the zooming -how would you stop at a particular zoom scale for instance?

hericles 289 Master Poster Featured Poster

Using SQL 2005 with VS 2008 is the same as using any other database, set your connection string correctly and your fine.
Generally with SQL you have an instance of the SQL server installed. I'm not actually sure if simply including a SQL database file will work the same way a .mdb will.
SQL server management is used for controlling your SQL server. You can create, edit and query tables, manage users, etc - everything you would need to do with a database server.

hericles 289 Master Poster Featured Poster

This article shows how to add user input screens to your set up project and use the input provided. it should cover what you need.
http://www.c-sharpcorner.com/UploadFile/ddoedens/CustomUI11102005042556AM/CustomUI.aspx

hericles 289 Master Poster Featured Poster

Use the app.config (or web.config for a web app). In the <Configuration> section of the app.config add this:

<connectionStrings>
        <add name="name_of_your_connection_string"
            connectionString="your_connection_string"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

There you access it in code via:

Dim conStr As String = ConfigurationManager.ConnectionStrings(name_of_your_connection_string).ConnectionString;