Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
QuestionHow to convert bmp or jpg into DICOM? Pin
Dejan Paunovic18-Oct-06 1:06
Dejan Paunovic18-Oct-06 1:06 
AnswerRe: How to convert bmp or jpg into DICOM? Pin
Christian Graus18-Oct-06 1:30
protectorChristian Graus18-Oct-06 1:30 
QuestionDatagrid and repeater allow paging Pin
iyoko18-Oct-06 0:45
iyoko18-Oct-06 0:45 
AnswerRe: Datagrid and repeater allow paging Pin
bhanu1234518-Oct-06 21:05
bhanu1234518-Oct-06 21:05 
GeneralRe: Datagrid and repeater allow paging Pin
iyoko21-Oct-06 5:34
iyoko21-Oct-06 5:34 
QuestionFtpClientConnection Pin
toink toink18-Oct-06 0:43
toink toink18-Oct-06 0:43 
QuestionChanging settings of an installed windows service. Pin
kulile18-Oct-06 0:33
kulile18-Oct-06 0:33 
QuestionInserting into a multiple Datasets with 1 method Pin
Gareth H17-Oct-06 23:49
Gareth H17-Oct-06 23:49 
What i need to do is to insert into a dataset. But the same method will insert into different type tables.

For instance, 1 table might have 5 columns, but another might only have 2.

<br />
foreach (DataRow theRow in dataClasses)<br />
{<br />
	//this gives me the name of the datatype<br />
	string className = theRow["Class_Name"].ToString();<br />
	object[] nodeSets = new object[9];<br />
<br />
	//tempdataset is the data in the database returned from the query<br />
	if (tempDataSet.Tables[0].Rows.Count != 0)<br />
	{<br />
		foreach (DataRow row in tempDataSet.Tables[0].Rows)<br />
		{<br />
				string CMDB_Version = row.ItemArray[4].ToString();<br />
				string Service = row.ItemArray[5].ToString();<br />
				string Label = row.ItemArray[6].ToString();<br />
				string Managed = row.ItemArray[7].ToString();<br />
				string Live = row.ItemArray[8].ToString();<br />
				string URL = row.ItemArray[9].ToString();<br />
				string Classification = row.ItemArray[10].ToString();<br />
				string Grouping = row.ItemArray[11].ToString();<br />
				string Profile_Name = row.ItemArray[12].ToString();<br />
<br />
				nodeSets[0] = CMDB_Version;<br />
				nodeSets[1] = Service;<br />
				nodeSets[2] = Label;<br />
				nodeSets[3] = Managed;<br />
				nodeSets[4] = Live;<br />
				nodeSets[5] = URL;<br />
				nodeSets[6] = Classification;<br />
				nodeSets[7] = Grouping;<br />
				nodeSets[8] = Profile_Name;<br />
<br />
				theSaveModelDataSet.Tables["New" + className].Rows.Add(nodeSets);<br />
		}<br />
	}<br />
}<br />


This is what i do at the moment, but this ofcourse will only work for 1 datatable.

So the question is, how do i create a peice of code that will insert the right amount of data into each column.

Regards,
Gareth.
AnswerRe: Inserting into a multiple Datasets with 1 method Pin
Robert Rohde18-Oct-06 0:10
Robert Rohde18-Oct-06 0:10 
GeneralRe: Inserting into a multiple Datasets with 1 method [modified] Pin
Gareth H18-Oct-06 1:51
Gareth H18-Oct-06 1:51 
GeneralRe: Inserting into a multiple Datasets with 1 method Pin
Robert Rohde18-Oct-06 3:28
Robert Rohde18-Oct-06 3:28 
GeneralRe: Inserting into a multiple Datasets with 1 method Pin
Gareth H19-Oct-06 23:41
Gareth H19-Oct-06 23:41 
GeneralRe: Inserting into a multiple Datasets with 1 method Pin
Robert Rohde20-Oct-06 21:38
Robert Rohde20-Oct-06 21:38 
QuestionMember hiding and polymorphism Pin
Mairaaj Khan17-Oct-06 23:43
professionalMairaaj Khan17-Oct-06 23:43 
AnswerRe: Member hiding and polymorphism Pin
Christian Graus18-Oct-06 0:01
protectorChristian Graus18-Oct-06 0:01 
AnswerRe: Member hiding and polymorphism Pin
saqib8218-Oct-06 0:01
saqib8218-Oct-06 0:01 
GeneralRe: Member hiding and polymorphism Pin
Christian Graus18-Oct-06 0:08
protectorChristian Graus18-Oct-06 0:08 
GeneralRe: Member hiding and polymorphism Pin
saqib8218-Oct-06 0:11
saqib8218-Oct-06 0:11 
GeneralRe: Member hiding and polymorphism Pin
Christian Graus18-Oct-06 0:19
protectorChristian Graus18-Oct-06 0:19 
GeneralRe: Member hiding and polymorphism Pin
Mairaaj Khan18-Oct-06 1:33
professionalMairaaj Khan18-Oct-06 1:33 
QuestionOverriding Hide method Pin
Mandaar Kulkarni17-Oct-06 23:03
Mandaar Kulkarni17-Oct-06 23:03 
AnswerRe: Overriding Hide method Pin
Martin#17-Oct-06 23:26
Martin#17-Oct-06 23:26 
GeneralRe: Overriding Hide method Pin
Mandaar Kulkarni18-Oct-06 0:03
Mandaar Kulkarni18-Oct-06 0:03 
Questioncalling Console Application from Windows Application? Pin
leanhsang17-Oct-06 22:57
leanhsang17-Oct-06 22:57 
AnswerRe: calling Console Application from Windows Application? Pin
Christian Graus17-Oct-06 23:00
protectorChristian Graus17-Oct-06 23:00 

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.