Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
GeneralRe: RE KINDLY SEE MY QNS Pin
chandtec2-Mar-05 8:26
chandtec2-Mar-05 8:26 
GeneralRe: colin kindly give me the steps how i shouls proceed to avoid it Pin
chandtec2-Mar-05 10:26
chandtec2-Mar-05 10:26 
GeneralRe: colin kindly give me the steps how i shouls proceed to avoid it Pin
Dave Kreskowiak3-Mar-05 0:46
mveDave Kreskowiak3-Mar-05 0:46 
GeneralRe: colin kindly give me the steps how i shouls proceed to avoid it Pin
chandtec3-Mar-05 16:39
chandtec3-Mar-05 16:39 
QuestionHow to determine if Object obj is a collection or not? Pin
rajesh.net2-Mar-05 5:20
rajesh.net2-Mar-05 5:20 
AnswerRe: How to determine if Object obj is a collection or not? Pin
Colin Angus Mackay2-Mar-05 5:32
Colin Angus Mackay2-Mar-05 5:32 
AnswerRe: How to determine if Object obj is a collection or not? Pin
S. Senthil Kumar2-Mar-05 7:28
S. Senthil Kumar2-Mar-05 7:28 
GeneralLooking for a better way to build a Dataset Pin
Adam °Wimsatt2-Mar-05 5:03
Adam °Wimsatt2-Mar-05 5:03 
I have a situation where I need to load 8 key value pairs into a DataSet manually.

The data looks like this:

Mon -- 123.4
Tues -- 232.1
Wed -- 187.4
...
EOW -- 923.6

I have to get these values into a DataSet. Is there a better (less lines of code) way to load it into a DataSet than to create a DataTable manually?

This is what I have so far:

<br />
DataSet ds = new DataSet();   <br />
DataTable dt = new DataTable("MCDVals");<br />
dt.Columns.Add("Legend", typeof(string) );<br />
dt.Columns.Add("Value", typeof(double) );<br />
<br />
DataRow dr = dt.NewRow();<br />
dr("Legend") = "Monday";<br />
dr("Value") = 123.4;<br />
dt.Rows.Add(dr);<br />
<br />
// ... above block repeats another 7 times for the other values<br />
<br />
ds.Tables.Add(dt);<br />


Thanks,
Adam


"...practice safe hex when IM'ing"
--Shawn L. Morrissey, Managing Editor, MSDN Online ( MSDN Flash; Volume 8, Number 20, 10/4/2004)
GeneralRe: Looking for a better way to build a Dataset Pin
leppie2-Mar-05 6:59
leppie2-Mar-05 6:59 
GeneralRe: Looking for a better way to build a Dataset Pin
Samar Aarkotti2-Mar-05 7:38
Samar Aarkotti2-Mar-05 7:38 
GeneralRe: Looking for a better way to build a Dataset Pin
Peter Vertes2-Mar-05 18:37
Peter Vertes2-Mar-05 18:37 
GeneralC# Application to Web Pin
Samar Aarkotti2-Mar-05 4:42
Samar Aarkotti2-Mar-05 4:42 
GeneralRe: C# Application to Web Pin
Adam °Wimsatt2-Mar-05 5:06
Adam °Wimsatt2-Mar-05 5:06 
GeneralRe: C# Application to Web Pin
Anonymous2-Mar-05 5:33
Anonymous2-Mar-05 5:33 
GeneralRe: C# Application to Web Pin
Adam °Wimsatt2-Mar-05 6:08
Adam °Wimsatt2-Mar-05 6:08 
GeneralRe: C# Application to Web Pin
Samar Aarkotti2-Mar-05 7:32
Samar Aarkotti2-Mar-05 7:32 
GeneralRe: C# Application to Web Pin
Adam °Wimsatt2-Mar-05 8:13
Adam °Wimsatt2-Mar-05 8:13 
GeneralRe: C# Application to Web Pin
Samar Aarkotti2-Mar-05 9:16
Samar Aarkotti2-Mar-05 9:16 
GeneralPlaying MPEG-1 audio data through DirectX.NET Pin
Member 17732982-Mar-05 4:36
Member 17732982-Mar-05 4:36 
GeneralSending contents of a text file via emails Pin
Un-Connected2-Mar-05 4:26
Un-Connected2-Mar-05 4:26 
GeneralRe: Sending contents of a text file via emails Pin
Esmo20002-Mar-05 5:47
Esmo20002-Mar-05 5:47 
QuestionHow to print form? Pin
redmat2-Mar-05 3:28
redmat2-Mar-05 3:28 
AnswerRe: How to print form? Pin
Judah Gabriel Himango2-Mar-05 4:10
sponsorJudah Gabriel Himango2-Mar-05 4:10 
GeneralRe: How to print form? Pin
redmat2-Mar-05 4:24
redmat2-Mar-05 4:24 
GeneralRe: How to print form? Pin
redmat3-Mar-05 2:41
redmat3-Mar-05 2: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.