ara12345
شنبه 03 شهریور 1386, 13:02 عصر
سلام
لطفا" بمن بگید Error برنامه من برای چیه؟
Format of the initialization string does not conform to specification starting at index 44
برنامه من:
publicpartialclassfrmparchehenter : Form
{
string strConn = "server=localhost;Data Source=\".\\SQLEXPRESS\";AttachDbFilename=\"C:\\Documents and Settings\\neda\\My Documents\\Visual Studio 2005\\Projects\\WindowsApplication1\\WindowsApplic ation1\\factory.mdf;Integrated Security=True;User Instance=True;database= factory";
SqlConnection scnn;
SqlDataAdapter sdacloths;
DataSet dscloths;
public frmparchehenter()
{
InitializeComponent();
this.scnn = newSqlConnection(strConn);
this.sdacloths = newSqlDataAdapter("Select * from Datagrid", scnn);
this.dscloths = newDataSet();
sdacloths.Fill(dscloths, "DataGrid");
dataGridView1.DataSource = dscloths;
dataGridView1.DataMember = "DataGrid";
}
(privatevoid BtnSave_Click(object sender, EventArgs e)
SqlConnection scnn = newSqlConnection(strConn);
SqlCommand scmdCloths = newSqlCommand();
scmdCloths.CommandText = " INSERT INTO Clothss " + "(Name , Family , DAte, weight,Number)" + " VALUES (@StrName ,@StrFamily , @StrDate ,@StrWeight ,@StrNumber)";
scmdCloths.Parameters.AddWithValue("@StrFamily",TxtFamily.Text);
scmdCloths.Parameters.AddWithValue("@StrDate",TxtDate.Text);
scmdCloths.Parameters.AddWithValue("@StrWeight",TxtWeight.Text);
scmdCloths.Parameters.AddWithValue("@StrNumber",TxtNumber.Text);
scnn.Open();
// scnn.strConn();
scmdCloths.ExecuteNonQuery();
{
لطفا" بمن بگید Error برنامه من برای چیه؟
Format of the initialization string does not conform to specification starting at index 44
برنامه من:
publicpartialclassfrmparchehenter : Form
{
string strConn = "server=localhost;Data Source=\".\\SQLEXPRESS\";AttachDbFilename=\"C:\\Documents and Settings\\neda\\My Documents\\Visual Studio 2005\\Projects\\WindowsApplication1\\WindowsApplic ation1\\factory.mdf;Integrated Security=True;User Instance=True;database= factory";
SqlConnection scnn;
SqlDataAdapter sdacloths;
DataSet dscloths;
public frmparchehenter()
{
InitializeComponent();
this.scnn = newSqlConnection(strConn);
this.sdacloths = newSqlDataAdapter("Select * from Datagrid", scnn);
this.dscloths = newDataSet();
sdacloths.Fill(dscloths, "DataGrid");
dataGridView1.DataSource = dscloths;
dataGridView1.DataMember = "DataGrid";
}
(privatevoid BtnSave_Click(object sender, EventArgs e)
SqlConnection scnn = newSqlConnection(strConn);
SqlCommand scmdCloths = newSqlCommand();
scmdCloths.CommandText = " INSERT INTO Clothss " + "(Name , Family , DAte, weight,Number)" + " VALUES (@StrName ,@StrFamily , @StrDate ,@StrWeight ,@StrNumber)";
scmdCloths.Parameters.AddWithValue("@StrFamily",TxtFamily.Text);
scmdCloths.Parameters.AddWithValue("@StrDate",TxtDate.Text);
scmdCloths.Parameters.AddWithValue("@StrWeight",TxtWeight.Text);
scmdCloths.Parameters.AddWithValue("@StrNumber",TxtNumber.Text);
scnn.Open();
// scnn.strConn();
scmdCloths.ExecuteNonQuery();
{