it is not inserted ...the code is as follows
is there any wrong with this code?...or..any other better coding rather than this
regards
mohamed aurif
Code:
try
{
con = new SqlConnection(@"Data Source=.\SQLExpress;Integrated Security=SSPI;AttachDBFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\pmsdb.mdf");
com = new SqlCommand("insert into initialdetails values('" + txtFName.Text + "','" + txtLName.Text + "'," + txtAge.Text + ",con");
con.Open();
textBox1.Text= "Successfully added";
}
catch (Exception ex)
{
textBox1.Text = ex.Message;
}
is there any wrong with this code?...or..any other better coding rather than this
regards
mohamed aurif
Comment