Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using C++.net Interfaces in C# Pin
Sandeep Datta25-Sep-07 19:56
Sandeep Datta25-Sep-07 19:56 
QuestionHow add rows and column into DataTable Pin
That's Aragon22-Sep-07 0:52
That's Aragon22-Sep-07 0:52 
AnswerRe: How add rows and column into DataTable Pin
pmarfleet22-Sep-07 0:59
pmarfleet22-Sep-07 0:59 
GeneralRe: How add rows and column into DataTable [modified] Pin
That's Aragon22-Sep-07 1:18
That's Aragon22-Sep-07 1:18 
GeneralRe: How add rows and column into DataTable Pin
pmarfleet22-Sep-07 1:40
pmarfleet22-Sep-07 1:40 
GeneralRe: How add rows and column into DataTable Pin
That's Aragon22-Sep-07 1:48
That's Aragon22-Sep-07 1:48 
GeneralRe: How add rows and column into DataTable Pin
pmarfleet22-Sep-07 1:54
pmarfleet22-Sep-07 1:54 
GeneralRe: How add rows and column into DataTable Pin
Lutosław22-Sep-07 2:09
Lutosław22-Sep-07 2:09 
You must add DataColumn objects to a table before you bind to them. Also you have another error which will not be catched by any compiler. Make meaningful names! Col_1 and Col_2 tells nothing!

I would do it like this:

DataTable table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Text", typeof(string));
DataRowView dr;
for (int i = 0; i < 10; i++) {
	dr = table.DefaultView.AddNew();
	dr["Name"] = "Name " + i.ToString();
	dr["Text"] = "Some text no. " + i.ToString();
}
table.AcceptChanges();




Greetings - Gajatko

Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.

Questiondouble vs float in performance Pin
small_programmer22-Sep-07 0:46
small_programmer22-Sep-07 0:46 
AnswerRe: double vs float in performance Pin
Colin Angus Mackay22-Sep-07 1:14
Colin Angus Mackay22-Sep-07 1:14 
GeneralRe: double vs float in performance Pin
small_programmer22-Sep-07 2:10
small_programmer22-Sep-07 2:10 
GeneralRe: double vs float in performance Pin
Paul Conrad22-Sep-07 5:02
professionalPaul Conrad22-Sep-07 5:02 
GeneralRe: double vs float in performance Pin
Luc Pattyn22-Sep-07 5:38
sitebuilderLuc Pattyn22-Sep-07 5:38 
GeneralRe: double vs float in performance Pin
Paul Conrad22-Sep-07 5:42
professionalPaul Conrad22-Sep-07 5:42 
GeneralRe: double vs float in performance Pin
Luc Pattyn27-Sep-07 3:39
sitebuilderLuc Pattyn27-Sep-07 3:39 
GeneralRe: double vs float in performance Pin
Paul Conrad27-Sep-07 4:41
professionalPaul Conrad27-Sep-07 4:41 
AnswerRe: double vs float in performance Pin
Guffa22-Sep-07 5:23
Guffa22-Sep-07 5:23 
AnswerRe: double vs float in performance Pin
Nissim Salomon22-Sep-07 11:03
Nissim Salomon22-Sep-07 11:03 
GeneralRe: double vs float in performance Pin
small_programmer22-Sep-07 20:25
small_programmer22-Sep-07 20:25 
Questionwindows service send xml to web application Pin
adhakshinamoorthy22-Sep-07 0:22
adhakshinamoorthy22-Sep-07 0:22 
QuestionFocusing on a control problem Pin
KeironN22-Sep-07 0:15
KeironN22-Sep-07 0:15 
AnswerRe: Focusing on a control problem Pin
Lutosław22-Sep-07 2:32
Lutosław22-Sep-07 2:32 
GeneralRe: Focusing on a control problem Pin
KeironN24-Sep-07 3:03
KeironN24-Sep-07 3:03 
QuestionExporting text in textboxes to Excel Sheet in C# Pin
iet200021-Sep-07 23:38
iet200021-Sep-07 23:38 
AnswerRe: Exporting text in textboxes to Excel Sheet in C# Pin
Paul Conrad23-Sep-07 6:41
professionalPaul Conrad23-Sep-07 6:41 

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.