السلام عليكم ورحمه الله وبركاته
عندي مشكله بسيطه
عند تنفيذ هذا الامر
OleDbCommand commend = new OleDbCommand("Select [Component-ID] From Compnent where [Process-Name]="+"'"+ MainForm.tabname+"'");
//commend.Connection.ConnectionString.ToString();
try
{
string myconn = this.componentTableAdapter1.Connection.ConnectionString.ToString();
OleDbConnection myconnection = new OleDbConnection(myconn);
myconnection.Open();
OleDbDataReader reder = commend.ExecuteReader();
while (reder.Read())
{
int id = (int)reder["component-ID"];
co.UpdateComponent(id, adv.componentname, adv.exDate, adv.MainPriod, adv.LastMintanceData
, MainForm.tabname);
}
}
catch (OleDBException e)
{
MessageBox.Show(e.ToString());
}
finally
{
this.componentTableAdapter1.Connection.Close();
}بيطلع error
InvalidOperationException
connection property isnot initialized
فهل حد عنده علم