hey man, this code only adds up 1 new row when u click the button the very first time; hence forth its just keeps updating the same row....can some one plz try a live example and help heres my code:
DataRow dRow=dsSMIC1.SMItem_Classification.NewRow(); dRow[0]=TextBox1.Text.Trim(); dRow[1]=TextBox2.Text.Trim(); dRow[2]=TextBox3.Text.Trim(); dsSMIC1.SMItem_Classification.Rows.Add(dRow); --- Naweed Akram <[EMAIL PROTECTED]> wrote: --------------------------------- I assume that you have a typed dataset, so here you go: DataRow dRow = dsSMIC1.SMItwm_Classification.NewRow; dRow.Field1="some value 1"; dRow.Field2="some value 2"; dsSMIC1.SMItwm_Classification.Rows.Add(dRow); HTH Naweed Akram -----Original Message----- From: hitesh c [mailto:[EMAIL PROTECTED] Sent: Thursday, January 13, 2005 7:50 AM To: [email protected] Subject: RE: [AspNetAnyQuestionIsOk] dynamic datarow DataTable dt=dsSMIC1.SMItem_Classification; dt.Rows.Add(new DataRow(new object[]{TextBox1.Text.ToString(),TextBox2.Text.ToString(),TextBox3.Text.ToS tring()})); the folowing statement led to 2 errors: 1: The best overloaded method match for 'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' has some invalid arguments 2: Argument '1': cannot convert from 'object[]' to 'System.Data.DataRowBuilder' --- Naweed Akram <[EMAIL PROTECTED]> wrote: --------------------------------- DataTable dtEmployees=some table...... dtEmployees.Rows.Add(new DataRow(some values)); Regards Naweed Akram -----Original Message----- From: devicekid [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 7:42 PM To: [email protected] Subject: [AspNetAnyQuestionIsOk] dynamic datarow can someone plz tel me how to add new datarows to a datatable on a click of a button Yahoo! Groups Links --------------------------------- Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony Yahoo! Groups Links --------------------------------- Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
