本文介绍了我如何在Windows身份验证中建立连接,我在Windows身份验证中没有任何用户ID和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void btnsubmit_Click(object sender, EventArgs e)
{
String connectionString = "server=...........;user id=....;password=....;database=abc";
SqlConnection thisConnection = new SqlConnection(connectionString);
thisConnection.Open();
String thisQuery = "INSERT INTO abc (ID, Name, ContactNo, Email, Address) VALUES (''" + txtid.Text + "'', ''" + txtname.Text + "'', ''" + txtcontact.Text + "'', ''" + txtemail.Text + "'', ''" + txtaddress.Text + "'')";
SqlCommand thisCommand = new SqlCommand(thisQuery, thisConnection);
SqlCommand cmd = new SqlCommand();
thisCommand.ExecuteNonQuery();
thisConnection.Close();
}
推荐答案
这篇关于我如何在Windows身份验证中建立连接,我在Windows身份验证中没有任何用户ID和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!