|
Hi Guys,
I am DataReader to get data from DB and dump the data into Excel sheet using XML's.
but,as the data reader holds the data for entire row, i am unable to get the data for other cells.
from datareader, i am getting <b>txt1, dt1, dt2 </b>in a single row, but i have to export this data to excel in multiple rows,
like
<pre>if (CurTaskNode.ReadFormat == "ColumnbyColumn")
{ for (int iCol = 0; iCol < lengthHeader; iCol++)
{
// Checking whether the Header data exists or not
if (CurTaskNode.HeaderData[minCol] != "")
{
//if (!(excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol]).Locked)
//{
// Assigning the Value from readerto to the particular cell in excel sheet
excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol] = values[iValueIndex];
iValueIndex++;
//}
}
minCol++;
}
minRow++;
}
</pre>
so, xml has 2 tasks namely projdata, projduration, so for the first task it should take the data and put in excel cell( 1,1 ) and in second task it should place it excel (10,2) and (10, 3)
< <Reference>
<SheetName>Setup_View</SheetName>
<TaskName>SubProjectName</TaskName>
<TaskName>ProjectDuration</TaskName>
</Reference> >
pleasee help me in modifying the code??
Thanks Ramm
|
|
|
|
|
hi guys
i want to read from a simulator (an clinical test device) which
is sending data on serial port , but i cant get correct data it shows junk characters ,
application works fine , simulator also shows correct output if connected with DockLight ,
any idea ?
thanks
regards ,
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
So you are saying that you can succesfully connect to the device and receive its data?
If so, what is your reason to think the data is not correct?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If you're getting junk characters when you're supposed to be getting nice looking text, you've most likely got the communication parameters wrong, like baud rate, stop bits, data bits, parity, handshaking, yada, yada, yada, ...
|
|
|
|
|
Hello,
I need to make some few update statements in my C# code (ORACLE database). The problem is that I can't keep it as stored procedure (statement must be in C# code).
My question is: do I have to commit this statement somehow ? In stored procedure there wouldn't be any problem but I'm not sure what to do with SQL statement in C# code
regards,
S.W.
|
|
|
|
|
No, you just execute the SQL, and it will execute normally.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Do you have any kind of database code in C# already working?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If you're running your code inside a transaction all you need do is call Commit on the transaction to commit the current transaction.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi ,
Im using following code to get gradient color to my form background but when ever i resize(maximize) it is getting flickering. Any thoughts to get rid of this?
Brush brush; Rectangle rct;
rct = new Rectangle(0, 0, this.ClientSize.Width, this.ClientSize.Height);
Color obj = Color.FromArgb(45, 132, 198);
brush =
new LinearGradientBrush(
rct,
Color.White, obj,
LinearGradientMode.BackwardDiagonal);
e.Graphics.FillRectangle(brush, rct);
In Form resize
this.Invalidate();
|
|
|
|
|
|
well as the other reply has suggested, you can set DoubleBuffer to true for the form, but also remove your code that calls Invalidate() in the Form's resize event. When the form resizes it will automatically redraw what it needs. You are basically telling the form and every control in the form to redraw itself unnecessaraly.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Dear Friend,
I have four DataTable Name "Table 1", "Table 2", "Table 3" and "Table 4" this table contain two rows each as given below
Data in "Table 1"
ID
1
2
Data in "Table 2"
ID Name
1 ABC
2 XYZ
Data in "Table 3"
ID Date
1 01/01/2009
2 02/01/2009
Data in "Table 4"
ID Value
1 AAA
2 XXX
This all table added in one DataSet related with each other using Relations with ID Column.
Now when i create XML file using this DataSet it Gives me in sequence as given below.
<?xml version="1.0" standalone="yes" ?>
<Data Set>
<Table 1>
<ID>1</ID>
</Table 1>
<Table 1>
<ID>2</ID>
</Table 1>
<Table 2>
<Name>ABC</Name>
</Table 2>
<Table 2>
<Name>XYZ</Name>
</Table 2>
<Table 3>
<Date>01/01/2009</Date>
</Table 3>
<Table 3>
<Date>02/01/2009</Date>
</Table 3>
<Table 4>
<Value>AAA</Value>
</Table 4>
<Table 4>
<Value>XXX</Value>
</Table 4>
</Data Set>
The problem is the sequence i want the same data in following sequence
<?xml version="1.0" standalone="yes" ?>
<Data Set>
<Table 1>
<ID>1</ID>
</Table 1>
<Table 2>
<Name>ABC</Name>
</Table 2>
<Table 3>
<Date>01/01/2009</Date>
</Table 3>
<Table 4>
<Value>AAA</Value>
</Table 4>
<Table 1>
<ID>2</ID>
</Table 1>
<Table 2>
<Name>XYZ</Name>
</Table 2>
<Table 3>
<Date>02/01/2009</Date>
</Table 3>
<Table 4>
<Value>XXX</Value>
</Table 4>
</Data Set>
Is this Possible? or there is another way to do this?
Please help me.
Thanks and Regards in advance
Sasmi
|
|
|
|
|
The only way to make that happen is to write your own serialization code for the dataset. Frankly, I wonder why every newbie who sees XML immediately thikns it's a database. It's not. XML is a data storage and transfer markup language. It is most assuredly NOT a good candidate for a database engine.
|
|
|
|
|
This is a weird one. I've got a form that the designer insists be checked out, or it (the designer) crashes and shows a stack trace that comes down to checkout failed. If I OK the checkout visual studio shows myform.cs [design], myform.cs, and myform.designer.cs as being modified. After saving, kdiff reports all three as being binary equal, and checking them in just repeats the cycle.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Sounds odd, although having lived with VS fighting Perforce for the past few years, nothing surprises me.
Which source control system are you using?
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
irrational clearcase; but what scc I use shouldn't have anything to do with if the designer wants to check the file out or not...
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I haven't used ClearCase myself, but the problems are more than likely in the integration between it and VS. There may be something just a tiny bit odd about that particular file which triggers a checkout.
Not having used that SCM system, best I can suggest is looking for support forums on their site, and either asking about this problem or seeing if anyone else has reported anything similar.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
molesworth wrote: Not having used that SCM system,
obviously not.
molesworth wrote: best I can suggest is looking for support forums on their site
According to my coworker who is the rational admin, the only thing more dysfunctional than the rational website for users is the fiasco that they inflict on admins.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
One of the three files in your form, is auto generated every time, so I assume it's just looking for write access. The issue could be that you have the auto generated file in source control, when there's no need for it to be.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ah, well spotted. A quick check shows I have three files checked into Perforce for each form, but they're "Form.cs", "From.Designer.cs" and "Form.resx".
I always add new files by hand, and know which ones to add, but maybe the ClearCase integration is adding the wrong things if you check in using the integrated tools.
That could be the problem...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Wait, which file is that?
Whacking myform.cs takes out all of my code, myform.designer.cs takes out all the controls on the form, and removing myform.resx causes the designer to puke and shows be a blank form if i ignore it.
The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at Microsoft.VisualStudio.Shell.Design.Serialization.DocData.CreateNativeDocData(IServiceProvider provider, String fileName)
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Ah, looks like you do have the same files as me checked in. Your original post mentioned something called "myform.cs [design]" which I thought was some sort of temporary intermediate file or something.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Sorry, that was the graphical representation of hte design on the tab list.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
By reverting to good pre change code and reapplying my updates one at a time and checking in I managed to find the problem.
The ToolStripContainer didn't present its size/anchoring in the Designer (a separate rant), so I was editing it in myform.designer.cs. The container had 1 toolbar and 1 menu (both with the grip hidden to keep them from being moved), but the container was 2.5 rows high. The toolbar and menu were both 24px tall, so I set the containers height to 48. That caused it to puke. I increased it by one pixel to 49 and it was happy.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Ah - glad you figured it out. I'll have to remember to watch for that in future...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|