Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Visual Studio 2012 (Databese Connectivity)
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Abhijit Chougule
9y
1.1k
1
Reply
I am getting the follpwing error
Error:System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'where'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection
I have writtrn the code for connction as
SqlConnection con=new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
con.Open();
string checkuser = "select count(*) from Userdata where Username = '" + txtUserName.Text + "'";
SqlCommand com = new SqlCommand(checkuser, con);
int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
if (temp == 1)
{
Response.Write("User Already Exists");
}
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
fetching records from multiple tables ado.net c#
Visual studio 2012