TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sathishka Priyad
NA
5
1.8k
INCORRECT SYNTAX NEAR 'SID'. HOW DO I SOLVE IT
Dec 22 2014 11:52 AM
try
{
byte[] img = null;
FileStream fs = new FileStream(imgLoc, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
img = br.ReadBytes((int)fs.Length);
string sql = "SET IDENTITY_INSERT studentregister ON;(sid,fname,lastname,address,email,contact,payment,image)VALUES(" + sid.Text + ",'" + sfn.Text + "','" + sln.Text + "','" + ad.Text + "','" + mail.Text + "','" + ct.Text + "','" + pn.Text + "',@img)";
if (con.State != ConnectionState.Open)
con.Open();
command = new SqlCommand(sql,con);
command.Parameters.Add(new SqlParameter("@img", img));
int x = command.ExecuteNonQuery();
con.Close();
MessageBox.Show(x.ToString() + "Record Saved");
}
catch (Exception ex) {
con.Close();
MessageBox.Show(ex.Message);
}
Reply
Answers (
5
)
Html editor (Table Section )-
WPF Cascading ComboBox to TextBox