לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #1  
ישן 07-06-2015, 10:50
  sael sael אינו מחובר  
 
חבר מתאריך: 03.03.15
הודעות: 7
הצגת נתונים בדתהגריד

הקוד הזה הוא לשליפת נתונים והצגתם בדתהגריד.
הנתונים נשלפים אך הוא לא מציג אותם בדתה גריד
//create the connection string
string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Directory.GetCurrentDirectory() + "\\YokraBaor.mdb";

//create the database query
string query = "SELECT * FROM tblHazmanot";

//create an OleDbDataAdapter to execute the query
OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);

//create a command builder
OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(dAdapter);

//create a DataTable to hold the query results
DataTable dTable = new DataTable();

//fill the DataTable
dAdapter.Fill(dTable);
//the DataGridView

//BindingSource to sync DataTable and DataGridView
BindingSource bSource = new BindingSource();

//set the BindingSource DataSource

bSource.DataSource = dTable;
for (int i = 0; i <= dTable.Rows.Count - 1; i++)
{
//dataGridView1.Rows[i].Cells[0].Value =dTable.Rows[i].ItemArray[0];
//dataGridView1.Rows[i].Cells[1].Value=dTable.Rows[i].ItemArray[1];
//dataGridView1.Rows[i].Cells[2].Value = dTable.Rows[i].ItemArray[2];
//dataGridView1.Rows[i].Cells[3].Value = dTable.Rows[i].ItemArray[3].ToString();
//dataGridView1.Rows[i].Cells[4].Value = dTable.Rows[i].ItemArray[4].ToString();
//dataGridView1.Rows[i].Cells[5].Value = dTable.Rows[i].ItemArray[5].ToString();
//dataGridView1.Rows[i].Cells[6].Value = dTable.Rows[i].ItemArray[6].ToString();
//dataGridView1.Rows[i].Cells[7].Value = dTable.Rows[i].ItemArray[7].ToString();

}
//set the DataGridView DataSource
dataGridView1.DataSource = bSource;
מהי הסבה לדעתכם?
תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 09:26

הדף נוצר ב 0.05 שניות עם 12 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2024 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר