Click here to Skip to main content
15,909,091 members
Home / Discussions / C#
   

C#

 
Generalhelp on openwith dialog Pin
deepakskumar12-Jan-05 21:17
deepakskumar12-Jan-05 21:17 
GeneralRe: help on openwith dialog Pin
Adam Goossens13-Jan-05 0:44
Adam Goossens13-Jan-05 0:44 
GeneralBackColor for MainMenu Pin
hybrid7912-Jan-05 19:39
hybrid7912-Jan-05 19:39 
Generalproblem with fontdialog Pin
The Nemesis12-Jan-05 19:33
The Nemesis12-Jan-05 19:33 
GeneralSmartClient Pin
IamADotNetGuy12-Jan-05 18:44
IamADotNetGuy12-Jan-05 18:44 
GeneralRe: SmartClient Pin
Michael P Butler13-Jan-05 9:04
Michael P Butler13-Jan-05 9:04 
Generalbinary file reading and converting Pin
bwagz12-Jan-05 18:19
bwagz12-Jan-05 18:19 
Generalerror in this c# program Pin
dhol12-Jan-05 17:55
dhol12-Jan-05 17:55 
Hi
I have a program which reads a xml schema file and also reads a input xm l file and if there is a element present in the schema which is also present in imput xml fle. it stores the vaues of input xml file for theat element intoa new xml file , while the other elements present in the schema are automatically getting values acccording to the datatype.

private void button2_Click(object sender, System.EventArgs e)
{
dataSet1.ReadXmlSchema(txtSchema.Text);//txtschema is the schema file
XmlDocument xdc = new XmlDocument();
foreach (DataTable dTbl in dataSet1.Tables)
{
object[] oValues = new object[dTbl.Columns.Count];
xdc.Load(@"C:\CDEV\generator\testdatagenerator\FIELDNAMES.xml");
int i=0, iIndex=0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(dColmn.ColumnName.ToString() == "billto_name")
{
iIndex = i;
break;
}
i++;
}
//INPUT XML FILE
xdc.Load(@"C:\CDEV\generator\testdatagenerator\billtoname.xml");
XmlNodeList nodeRows;
XmlElement Root = xdc.DocumentElement;
nodeRows = Root.SelectNodes("//billto_name");
for(int j = 0; j <= 200; j++)
{
int k = 0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(j == iIndex && j <nodeRows.Count)
oValues[j] = nodeRows.Item(i).InnerText;
else
{
switch(dColmn.DataType.ToString())
{
case "System.String":
oValues[k] = (string) "castle Hampers" + j;
break;

case "System.Int32":
oValues[k] = (int) 66 + j;
break;

case "System.DateTime":
oValues[k] = new DateTime(2004,01,30).AddDays(j + 1);
break;

case "System.Decimal":
oValues[k] = new Decimal(1900.99) + j;
break;

case "System.Int16":
oValues[k] = (short) 3256 + j;
break;

case "System.Int64":
oValues[k] = (long) 400 + j;
break;

case "System.Double":
oValues[k] = (double) 8888 - j;
break;

case "System.Single":
oValues[k] = (float) 4.5 + j;
break;
}
}
}
dTbl.Rows.Add(oValues);
}
}
}


I view the data's through a datagrid. But I get values only for the first field and the others are showing only null

santhosh
GeneralRe: error in this c# program Pin
leppie12-Jan-05 21:49
leppie12-Jan-05 21:49 
GeneralRe: error in this c# program Pin
dhol13-Jan-05 1:03
dhol13-Jan-05 1:03 
GeneralRe: error in this c# program Pin
leppie13-Jan-05 4:57
leppie13-Jan-05 4:57 
GeneralRe: error in this c# program Pin
dhol13-Jan-05 16:52
dhol13-Jan-05 16:52 
GeneralChange image property of a picturebox object at run time Pin
Einar Kvandahl12-Jan-05 15:45
Einar Kvandahl12-Jan-05 15:45 
GeneralRe: Change image property of a picturebox object at run time Pin
Adam Goossens13-Jan-05 1:01
Adam Goossens13-Jan-05 1:01 
GeneralClass / Database design document Pin
econner12-Jan-05 15:17
econner12-Jan-05 15:17 
GeneralRe: Class / Database design document Pin
Adam Goossens13-Jan-05 1:05
Adam Goossens13-Jan-05 1:05 
GeneralWindows ContextMenu... Pin
new_phoenix12-Jan-05 13:45
new_phoenix12-Jan-05 13:45 
GeneralRe: Windows ContextMenu... Pin
Guinness4Strength12-Jan-05 13:52
Guinness4Strength12-Jan-05 13:52 
GeneralRe: Windows ContextMenu... Pin
new_phoenix13-Jan-05 9:24
new_phoenix13-Jan-05 9:24 
GeneralDirectX 9 &amp; c# problem Pin
dratcha12-Jan-05 12:28
dratcha12-Jan-05 12:28 
GeneralSimple ListBox Event Pin
Snowjim12-Jan-05 12:27
Snowjim12-Jan-05 12:27 
GeneralRe: Simple ListBox Event Pin
Stefan Troschuetz12-Jan-05 21:41
Stefan Troschuetz12-Jan-05 21:41 
GeneralRe: Simple ListBox Event Pin
Snowjim12-Jan-05 23:21
Snowjim12-Jan-05 23:21 
GeneralRe: Simple ListBox Event Pin
Stefan Troschuetz12-Jan-05 23:30
Stefan Troschuetz12-Jan-05 23:30 
GeneralVS.NET Add-In Problem Pin
Guinness4Strength12-Jan-05 12:13
Guinness4Strength12-Jan-05 12:13 

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.