i'm getting login failed for user error plz help me
my code is
app.config
connectionString="Data Source=jiyalal-pc\SQLEXPRESS;Initial Catalog= Database1;Integrated Security=false;User Instance=true"
providerName="System.Data.SqlClient" />
and my WindowsFormsApplication1.cs code
private void button1_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["WindowsFormsApplication1.Properties.Settings.Database1ConnectionString"].ConnectionString);
con.Open();
SqlCommand com = new SqlCommand("insert into tt values('" + textBox1.Text + "')", con);
int h = com.ExecuteNonQuery();
if (h > 0)
{
MessageBox.Show("saved");
}
con.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
plz help
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ranjit PowarPosted Mar 6, 2015, 11:11 PM