Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mr_dayal
Starting Member
37 Posts |
Posted - 2008-07-28 : 05:26:35
|
I m using a database located in my app_data folder (database1.mdf)which is a local sql server express edition database.I have a table payout_master having three fileds (srno,name,date) ,srno is atoincrementing..Now I define these variables .. Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\app_data\Database1.mdf;Integrated Security=True;User Instance=True")sub xyzIf con.State = ConnectionState.Closed Then con.Open()End If cmd = New SqlCommand("Insert into payout_master (payout_name,payout_date) values (@name,@p_date)", con) cmd.Parameters.AddWithValue("@name", Trim(txt_payoutname.Text)) cmd.Parameters.AddWithValue("@p_date", CDate(MaskedTextBox3.Text)) cmd.ExecuteNonQuery() MsgBox("Payout added sucessfully!") con.Close()end subthis is not giving any errors but I am not able to see updated /new records in the table.What could be the problem..Plz helpMr Dayal |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-07-28 : 08:26:57
|
1) are you sure this code is even being executed? Step through the code and make sure that these lines are executed. You may have an event not working correctly, or some logic somewhere that isn't allowing this code to be called.2) Do you have a try/catch around this ? (or ON ERROR RESUME NEXT?) Are there errors happening that you are ignoring? - Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
|
|
|