i want to bind datagridview to a custom query not just a table
is it possible if it is can anyone tell me how to do this in details i am a beginner in dot net development
thanks
i want to bind datagridview to a custom query not just a table
is it possible if it is can anyone tell me how to do this in details i am a beginner in dot net development
thanks
السلام عليكم
ادخل على هذا الرابط وحمل الكتاب هتلاقى فى جزء خاص بال Data Binding
ان شاء الله يفيدك
ورجاء أخي الكريم اكتب بالعربيه :)
عزيزى mohamed_en ايا كان الاستعلام سواء يرجع جدول او معلومات من جدول بناء على شرط لا تختلف كثيرا الاختلاف الوحيد فى جملة
الاستعلام وهذا الكود سيساعدك على تفهم ذلك وارجوا ان اكون افدتك
string strcon = @"provider = Microsoft.jet.oledb.4.0; data source = phonebook.mdb"
OleDbConnection con = new OleDbConnection(strcon);
OleDbCommand com = new OleDbCommand("select * from phonebook where [name] = 'ahmed'", con);
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = com;
da.Fill(ds, "phonebook");
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "phonebook";