No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I have an following code in this I returned the dataset,but dont no how to use this dataset.Code is running,but not save the record in datase. I had use same code vb.net,it works. Plz help me... ==================================================== [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; … |
|
[code] SqlConnection cn = new SqlConnection(MyConn.cnstring); //string sql = "insert into Insert1 values(?,?,?,?,?)"; SqlCommand cmd ; cmd = new SqlCommand("insert into Insert1 values(?,?,?,?,?)", cn); cmd.Parameters.AddWithValue("sname", txtname.Text); cmd.Parameters.AddWithValue("srno", txtrno.Text); cmd.Parameters.AddWithValue("sdob", dob.Value); cmd.Parameters.AddWithValue("sadd", txtadd.Text); cmd.Parameters.AddWithValue("sgender", cmdgender.Text); cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); [/code] When I use this code folowing error will gererate "Incorrect syntax near … |