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
Prudhvi Raj
NA
17
1.5k
Error near objCommand.ExecuteNonQuery();
May 3 2017 1:18 AM
Error:
Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll
Additional information: Incorrect syntax near the keyword 'Table'.
CODE:
string ConnectionString = "Data Source=LocalHost;Initial Catalog=radiant;Integrated Security=True;Pooling=False";
SqlConnection objconnection = new SqlConnection(ConnectionString);
objconnection.Open();
// fire the command object
string strInsertCommand = "Insert into table [Table ] Values('"
+ tbun.Text + "','"
+ cbcountry.Text + "','"
+ gender + "','"
+ hobbies + "',"
+ rbmarried.Checked + ")";
SqlCommand objCommand = new SqlCommand(strInsertCommand, objconnection);
objCommand.ExecuteNonQuery();
objconnection.Close();
Reply
Answers (
5
)
Machine Learning for running a sql query
Set time for Sending Mail