hey, thank you so much...it works! regards :-D :rose:
jing
hey, thank you so much...it works! regards :-D :rose:
jing
hi, thanks, it works. the value from datagridview1 will be transfered to datagridview 2. but what if i want it this way... dataGridView2.CurrentRow.Cells[5].Value = dataGridView1.CurrentRow.Cells[0].Value; dataGridView2.CurrentRow.Cells[6].Value = dataGridView1.CurrentRow.Cells[0].Value; if i select Cell 5 of dgv2, the selected value of cell 0 of dgv1 will displayed on cell 5 of dgv2 if i select cell 6 of dgv2, the selected value of cell 0 of dgv1 will be displayed on cell 6 of dgv2? thanks..hoping for a reply:rose:
jing
hi, i have this datagridview that will transfer (by double clicking) the selected celrow to another datagridview.but the selected row value will be displayed on the selected cell of the other datagridview. i hope i made myself clear:doh: private void dataGridView4_DoubleClick(object sender, EventArgs e) { int rowIndex = dataGridView4.CurrentRow.Index; //selected row of source datagridview int currentCell = dataGridView2.CurrentRow.Index;//selected cell of the destination datagridview long supplier1 = 0; long currentColumn = 0; supplier1 = Convert.ToInt64(dataGridView4.Rows[rowIndex].Cells[0].Value.ToString()); //value of selected row string[] data = { supplier1.ToString() }; if (currentCell == 5) //destination datagridview's cell index { dataGridView2.Rows.Add(data);//add value to destination } } its not working..:((will pls give me a sample snippet..tnx!! regards:rose:
jing
hi how to add a combo box (dropdownlist style) to a datagridview Cell? thanks...hoping for your reply.... regards:) :rose:
jing
thats it!! tnx!
jing
hi, thanks...il try this one... i appreciate it... regards:) ;)
jing
hi, how to insert the value of my datetimepicker to my database table? this is my code: private void button6_Click(object sender, EventArgs e) { try { string dateneeded = dateTimePicker6.Value.ToLongDateString(); String query = "INSERT INTO purchaserequest(dateneeded) VALUES (DATE_FORMAT(dateneeded,'%Y-%m-%d')"; MySqlCommand command = new MySqlCommand(query, connection); command.ExecuteNonQuery(); } catch (MySqlException mse) { MessageBox.Show(mse.Message); } } its not working:) thanks in advance:) regards:)
jing
thanks
jing
hi, how to insert textbox values into datagridview??? pls. reply, ill appreciate it:)
jing
hi, alright thanks, il try it... regards:)
jing
hi, how to insert the item chosen from the combo box to a database table? regards:)
jing
thanks buddy... regards:)
jing
hi, how to create an autoincrement id to be displayed on a textbox? the id will then be stored in the database table... i have already created my code for that problem but it behaves differently.it behaves like this...if the current value of my pur_requestid in the table is null, then there would be no value displayed in the textbox. but if i inserted a value like 1 then when i execute my program the textbox receives 2. i want my textbox to automatically display 1 eventhough i will NOT insert a value on my table. my code that behaves differently...supposed to be the event being fired is when the user clicks the button NEW a purchase request id will be generated.. private void button7_Click(object sender, EventArgs e) { MySqlDataReader reader = null; try { String query = "Select last_insert_id(pur_requestid) as lastinsertedid from purchaserequest where lpur_requestid = null order by pur_requestid desc limit 1"; MySqlCommand command = new MySqlCommand(query, connection); reader = command.ExecuteReader(); if (reader.Read()) { currentId = reader.GetInt64("lastinsertedid"); currentId = currentId + 1; textBox1.Text = currentId.ToString(); } } catch (MySqlException mse) { MessageBox.Show(mse.Message); } finally { if (reader != null) { reader.Close(); } } thanks, hoping for your reply... regards:) -- modified at 22:59 Tuesday 8th May, 2007
jing
hi, thanks, i accept all your comments and reactions positively... actually, i have been working on it, you're right am working on a specific client. what i mean on the article that am asking for are example codes, screenshots just for supplementary purposes... ok? regards:)
jing
hi, thanks, my program already worked out!! regards:)
jing
hi, am currently working on a purchasing system project...using c# and MySql.can somebody send me an article about this project... thank you guys, hoping for your reply... regards:)
jing
hi everybody, thanks for your reply and suggestions, finally i got the solution to my problem... my revised code: private void button13_Click(object sender, EventArgs e) { try { for (int i = 0; i < dataGridView4.Rows.Count -1; i++) { DataGridViewRow row = dataGridView4.Rows[i]; long itemcode = 0; string description = ""; int quantity = 0; string unit = ""; itemcode = Convert.ToInt64(row.Cells[0].Value); if (description != null) { description = row.Cells[1].Value.ToString() + ""; } quantity = Convert.ToInt32(row.Cells[2].Value); unit = row.Cells[3].Value.ToString(); String query = "INSERT INTO test(itemcode,description,quantity,unit) VALUES (" + " " + itemcode + " ,'" + description + "'" + " , " + quantity + " ,'" + unit + "'" + " )"; MySqlCommand command = new MySqlCommand(query, connection); MessageBox.Show(command.ExecuteNonQuery().ToString()); } } thanks guys regards:)
jing
hi, ok, it try to get the logic of your program so I could migrate it to MySql... regards:)
jing
hi, thanks.. yap,through the debugger,i've found out that row.Cell[1].Value is null.i'm trying to fix it right now... :)
jing
hi, by the way will you please help me on how to insert values from the datagridview to the database table? waiting for your reply:)
jing