Click here to Skip to main content
15,914,111 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Does garbage collection in .Net multithreaded nowadays? Pin
followait24-Sep-08 22:28
followait24-Sep-08 22:28 
GeneralRe: Does garbage collection in .Net multithreaded nowadays? Pin
Mark Churchill25-Sep-08 0:31
Mark Churchill25-Sep-08 0:31 
AnswerRe: Does garbage collection in .Net multithreaded nowadays? Pin
Kevin McFarlane16-Sep-08 8:49
Kevin McFarlane16-Sep-08 8:49 
GeneralRe: Does garbage collection in .Net multithreaded nowadays? Pin
followait17-Sep-08 17:47
followait17-Sep-08 17:47 
GeneralRe: Does garbage collection in .Net multithreaded nowadays? Pin
Dave Kreskowiak19-Sep-08 7:57
mveDave Kreskowiak19-Sep-08 7:57 
RantApp_Code problem Pin
Richard Jones15-Sep-08 3:35
Richard Jones15-Sep-08 3:35 
GeneralRe: App_Code problem Pin
Steven A. Lowe16-Sep-08 15:45
Steven A. Lowe16-Sep-08 15:45 
QuestionFilling a DataGridView containing a ComboBox Pin
akhi4akhil14-Sep-08 19:37
akhi4akhil14-Sep-08 19:37 
Hi,

I am creating a windows application in which i have got a DataGridView containing some comboboxes and checkboxes. Is there a way to fill the DataGridView from the database. Now i am filling the datagrid cell by cell seperately. Also there exist problem while updating the database. I am giving my code with this. Will anyone help me out of this.
1 public void LoadData(int tabcnt)   
2 {   
3 string module = this.tabControl1.SelectedTab.Text.Trim();   
4   
5 string connString;   
6   
7 string query = "";   
8   
9 connString = ConfigurationSettings.AppSettings.Get("ProjDB").ToString().Trim();   
10   
11 if (module != "")   
12 {   
13 query = "SELECT * FROM Module_Requirements where Module='" + module + "'";   
14 }   
15 else  
16 {   
17 MessageBox.Show("There Is No Modules", "No Modules", MessageBoxButtons.OK, MessageBoxIcon.Information);   
18 }   
19   
20 dAdapter = new MySqlDataAdapter(query, connString);   
21   
22 MySqlCommandBuilder cBuilder = new MySqlCommandBuilder(dAdapter);   
23   
24 DataSet ds = new DataSet();   
25   
26 ds.Clear();   
27   
28 try  
29 {   
30 dAdapter.Fill(ds);   
31 BindingSource bSource = new BindingSource();   
32 }   
33 catch (Exception ex)   
34 {   
35 MessageBox.Show(ex.Message);   
36 }   
37   
38 //ucMod[tabcnt].gridLineDataGridView1.DataSource = ds; //this code is not working   
39   
40 int iRowCnt = ds.Tables[0].Rows.Count;   
41   
42 ucMod[tabcnt].gridLineDataGridView1.Rows.Clear();   
43   
44 for (int ctrRow = 0; ctrRow < iRowCnt; ctrRow++)   
45 {    
46 ucMod[tabcnt].gridLineDataGridView1.Rows.Add();   
47 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[1].Value = ucMod[tabcnt].Column2.Items[ucMod[tabcnt].Column2.Items.IndexOf(ds.Tables[0].Rows[ctrRow][1].ToString().Trim())];    
48 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[2].Value = ds.Tables[0].Rows[ctrRow][0].ToString().Trim();   
49 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[3].Value = ds.Tables[0].Rows[ctrRow][2].ToString().Trim();   
50 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[4].Value = ds.Tables[0].Rows[ctrRow][3].ToString().Trim();   
51 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[5].Value = ds.Tables[0].Rows[ctrRow][4].ToString().Trim();   
52 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[6].Value = ds.Tables[0].Rows[ctrRow][5].ToString().Trim();   
53 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[7].Value = ds.Tables[0].Rows[ctrRow][6].ToString().Trim();   
54 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[8].Value = ucMod[tabcnt].Column9.Items[ucMod[tabcnt].Column9.Items.IndexOf(ds.Tables[0].Rows[ctrRow][7])];   
55 ucMod[tabcnt].gridLineDataGridView1.Rows[ctrRow].Cells[9].Value = ucMod[tabcnt].Column10.Items[ucMod[tabcnt].Column10.Items.IndexOf(ds.Tables[0].Rows[ctrRow][8].ToString().Trim())];    
56 }   
57 }  




Thanks
Akhil
AnswerRe: Filling a DataGridView containing a ComboBox Pin
srabik15-Sep-08 2:48
srabik15-Sep-08 2:48 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
srabik15-Sep-08 3:13
srabik15-Sep-08 3:13 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
akhi4akhil16-Sep-08 0:22
akhi4akhil16-Sep-08 0:22 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
akhi4akhil16-Sep-08 1:25
akhi4akhil16-Sep-08 1:25 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
akhi4akhil16-Sep-08 0:04
akhi4akhil16-Sep-08 0:04 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
srabik16-Sep-08 2:57
srabik16-Sep-08 2:57 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
akhi4akhil16-Sep-08 17:14
akhi4akhil16-Sep-08 17:14 
GeneralRe: Filling a DataGridView containing a ComboBox Pin
akhi4akhil16-Sep-08 0:19
akhi4akhil16-Sep-08 0:19 
QuestionClickOnce Deployment - force download file with different version but same hash Pin
srabik14-Sep-08 13:32
srabik14-Sep-08 13:32 
QuestionBorder+ColorAnimation (Borderbrush) Pin
Stevie14-Sep-08 8:25
Stevie14-Sep-08 8:25 
AnswerRe: Border+ColorAnimation (Borderbrush) Pin
Stevie14-Sep-08 8:35
Stevie14-Sep-08 8:35 
QuestionForm crashes to taskbar when left minimized? [modified] Pin
teddycrew12-Sep-08 0:23
teddycrew12-Sep-08 0:23 
AnswerRe: Form crashes to taskbar? Pin
led mike12-Sep-08 5:02
led mike12-Sep-08 5:02 
GeneralRe: Form crashes to taskbar? Pin
teddycrew12-Sep-08 12:58
teddycrew12-Sep-08 12:58 
Questioninstallation issue of dot net 2005 Pin
onrivman11-Sep-08 21:19
onrivman11-Sep-08 21:19 
AnswerRe: installation issue of dot net 2005 Pin
Pete O'Hanlon11-Sep-08 22:11
mvePete O'Hanlon11-Sep-08 22:11 
GeneralHelp required in SQL query Pin
khalidd11-Sep-08 0:06
khalidd11-Sep-08 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.