moh.mon
شنبه 08 خرداد 1389, 21:41 عصر
سلام دوستان.
من کد زیر رو برای اتصال به پایگاه داده ی اکسس نوشتم ولی میگه که name متعلق به هیچ جدولی نیست.
کمک کنید. من که حسابی گیج شدم http://www.forum.p30world.com/images/New-smile/N_aggressive%20%2840%29.gif
OleDbConnection oled= new OleDbConnection();
oled.ConnectionString= @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\Mohammad\Documents\Visual Studio 2008\Projects\WebSite3\hamayesh.accdb";
oled.Open();
OleDbDataAdapter oled_dataadaptr= new OleDbDataAdapter();
oled_dataadaptr = new OleDbDataAdapter("SELECT Name, Surname, [E-mail], [Phone-number], Company, [Company-Adress], Website, egamat FROM [personal_info]", oled);
OleDbCommandBuilder oled_comandbuilder= new OleDbCommandBuilder();
DataTable oled_datatable = new DataTable();
int oled_rowposition =0;
DataRow oled_datarow = oled_datatable.NewRow();
oled_datarow["Name"] = TextBoxName.Text;
oled_datarow["Surname"] = TextBoxSurename.Text;
oled_datarow["[E-mail]"] = TextBoxemail.Text;
oled_datarow["[Phone-number]"] = TextBoxphone.Text;
oled_datarow["Company"] = TextBoxcompany.Text;
oled_datarow["[Company-Adress]"] = TextBoxcompanyadress.Text;
oled_datarow["Website"] = TextBoxAdress.Text;
oled_datarow["egamat"] = TextBoxegamat.Text;
oled_datatable.Rows.Add(oled_datarow);
oled_dataadaptr.Update(oled_datatable);
oled_rowposition = oled_datatable.Rows.Count -1;
من کد زیر رو برای اتصال به پایگاه داده ی اکسس نوشتم ولی میگه که name متعلق به هیچ جدولی نیست.
کمک کنید. من که حسابی گیج شدم http://www.forum.p30world.com/images/New-smile/N_aggressive%20%2840%29.gif
OleDbConnection oled= new OleDbConnection();
oled.ConnectionString= @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\Mohammad\Documents\Visual Studio 2008\Projects\WebSite3\hamayesh.accdb";
oled.Open();
OleDbDataAdapter oled_dataadaptr= new OleDbDataAdapter();
oled_dataadaptr = new OleDbDataAdapter("SELECT Name, Surname, [E-mail], [Phone-number], Company, [Company-Adress], Website, egamat FROM [personal_info]", oled);
OleDbCommandBuilder oled_comandbuilder= new OleDbCommandBuilder();
DataTable oled_datatable = new DataTable();
int oled_rowposition =0;
DataRow oled_datarow = oled_datatable.NewRow();
oled_datarow["Name"] = TextBoxName.Text;
oled_datarow["Surname"] = TextBoxSurename.Text;
oled_datarow["[E-mail]"] = TextBoxemail.Text;
oled_datarow["[Phone-number]"] = TextBoxphone.Text;
oled_datarow["Company"] = TextBoxcompany.Text;
oled_datarow["[Company-Adress]"] = TextBoxcompanyadress.Text;
oled_datarow["Website"] = TextBoxAdress.Text;
oled_datarow["egamat"] = TextBoxegamat.Text;
oled_datatable.Rows.Add(oled_datarow);
oled_dataadaptr.Update(oled_datatable);
oled_rowposition = oled_datatable.Rows.Count -1;