I'm a beginner to VB.net 2005. I've started creating a small database project by refering to some VB.net books. I've know the use of dataadapter, datareader, commandbuilder etc which are required to connect to the database. I'm using Microsoft SQL Server Database File (SqlClient) for my project. I've used the sqlreader to display the database onto the windows form controls. But i can't add the records to the database. When i run the program and add the records to the database it add those records only to the dataset but the changes are not reflected to the database. Here is the code which i used to update the database which does not work.
Dim myCommand As SqlCommand
myCommand.CommandType = CommandType.Text
connlyrics.Open()
varid= TextBox6.Text
varname = TextBox7.Text
varaddr = TextBox8.Text
myCommand = New SqlCommand("Insert into Employee (empid, name, Addr) values ('" & varid & "','" & varname & "','" & varaddr & "')", conn)
myCommand.ExecuteNonQuery()
da.Update(ds, "EmpDataSet")
MessageBox.Show("New Row Inserted")
connlyrics.Close()
What are the changes to be made in the code.
My second question is that if this program works fine is it really possible to make a installation (setup) file of this project. Are there any changes to be made in the project code. The connection string is used to link the database file. My project uses the following connection string to link to the database.
conn.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Employee.mdf;Integrated Security=True"
Now if the setup file of this code is created and installed in another computer does it really work. Is there any modifications to be made in the connection string.
Can anynbody tell me the complete procedure (step by step) to make a complete database application software (using VB.vet and Microsoft SQL Server Database File) from the beginning (Creating a new project) till the end (setup file).