|
Is Category a string? If it's an integer, you should use an object[] instead.
Logifusion[^]
|
|
|
|
|
It was originally a string, but thats not the problem i'm having. The problem is writing back a call.
|
|
|
|
|
Well, what I would try if I were you is make the DataRow first: DataRow dr = d.Tables["Call"].NewRow();
Then I would apply the same values but to the actual row and see where it breaks:
dr["id"] = assignID();
dr["User"] = User;
dr["Category"] = Category;
dr["Description"] = Description;
If there's a problem with the data, at least you can pinpoint the line where it happens.
Logifusion[^]
|
|
|
|
|
No problems with the data it writes it to the file, but it puts it outside the </ServiceRequest> element which breaks the xml schema.
|
|
|
|
|
Sorry, I didn't understand the original question. I guess the thing you have to look at is that when you load an XML like this into a DataSet, it will silently create extra keys and relations between nested tables. You might want to take a look at the real structure of the "Call" table in a debug window and see what columns are really there.
Logifusion[^]
|
|
|
|
|
The problem is with your schema: you have two different definitions for category. The first (in ServiceCategory) is a complexy type with a sequence of simple types, the second (in ServiceRequest) is just a single element simple type. to do this, you should give them different names (Category and CallCategory).
Or try modeling themn as classes and using the xsd tool to create the corresponding schema.
|
|
|
|
|
Fixed it. It was because i didnt define the Parent Row, added it on the end instead of nesting it.
The finished code is:
DataRow Child = d.Tables["Call"].NewRow();<br />
Child["id"] = assignID();<br />
Child["User"] = User;<br />
Child["CallCategory"] = Category;<br />
Child["Description"] = Description;<br />
Child.SetParentRow(d.Tables["ServiceRequest"].Rows[0]);<br />
d.Tables["Call"].Rows.Add(Child);<br />
d.WriteXml(Server.MapPath("ServiceDeskData.xml"));
|
|
|
|
|
This code below works.
XmlQuery xmls = new XmlQuery(SavedFilePath + file);<br />
node = xmls.SelectMultipleAttributes("/AutorunArchitect/Files/File/@*");<br />
<br />
br = 1; int b =0;<br />
ListViewItem lst = null;<br />
while (node.MoveNext())<br />
{<br />
temp[b,br-1] = node.Current.Value;<br />
<br />
if (br % 4 == 0)<br />
{<br />
b++;<br />
br=0;<br />
}<br />
<br />
br++;<br />
}<br />
<br />
for (i=0; i <2; i++)<br />
{<br />
lst = listView1.Items.Add(temp[i,0]);<br />
lst.SubItems.Add(temp[i,1]);<br />
lst.SubItems.Add(temp[i,2]); <br />
}
This is the test XML file
<AutorunArchitect> <br />
<Files><br />
<File<br />
FileName="files.exe"<br />
FileSize="123.4 KB"<br />
FilePath="C:\test\"<br />
FileDescription="Program description1."<br />
/><br />
<File<br />
FileName="files.html"<br />
FileSize="14 KB"<br />
FilePath="C:\test_backup\"<br />
FileDescription="Program description2."<br />
/><br />
</Files><br />
</AutorunArchitect>
Everything runs great, but I was just wondering is this a good aproach or is there any other way that makes the code to run faster?
Thanks.
|
|
|
|
|
Hello,
I have seen lot's of example of RTC Client. But all are in VS6(VC++6 or VB6). Now I want to use it with C#.Net. Can any one tell me how to do this. I also seen some articles releted to RTC from this site. But found no satisfied result.
regards,
Divyang Mithaiwala
|
|
|
|
|
Hi
I have a form with some controls, in it, most of them are labels, and a panel for displaying video and one of label is blinking using timer.
sometimes i got an Overflow exception when a program is started and sometimes when label is blinking. this exception is random and not always thrown. when exception comes, it comes with quit and continue, and have detials of the stack trace, when continued, the one control which is mentioned in the stack trace are turned to red cross. this is happening with two three controls.
Regards
Shajeel
|
|
|
|
|
|
here is the complete exception which is not stackoverflow
************** Exception Text **************
System.OverflowException: Overflow error.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height)
at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.Control.InvokePaintBackground(Control c, PaintEventArgs e)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)<<<<
|
|
|
|
|
|
i have posted the same question on msdn forums, and after some help from people there it turns out that it may be caused by the use terminal like vnc or remote desktop. but still i havent found the way around.
u can see that here
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=505364&SiteID=1&PageID=0
thanks for help.
Regards
Shajeel
|
|
|
|
|
Hello guys,
I'm halfway of my program when I encounter a problem.
i'm trying to substring "test" string by this command(sample only):
string strTest = "test";
MessageBox.Show(strTest.SubString(2, 3));
and I get this result: t
My desired result is: st
but I got my desired result with this code:
string strTest = "test";
MessageBox.Show(strTest.SubString(2, 2));
I can't get why this happened. Code was supposed to be MessageBox.Show(strTest.SubString(2, 3)); right?
Thank you in advance...
|
|
|
|
|
t e s t
0 1 2 3
SubString(initial Position , lenght)
SubString(2, 2) is ok for get "st"
with SubString(2,3) you got an exception (System.ArgumentOutOfRangeException)
|
|
|
|
|
I think what he means is that SubString parameters are not begin and end position (like in Java), rather begining position and how much further from there,
Ex
Test
0123
SubString(2,2) - Te and two place further gives s and t. Third is out of arrays so System.ArgumentOutOfRangeException is thrown
|
|
|
|
|
Guys,,,
Thank you so much. Now I understand that the second parameter is the lenght, not the position of the character where you want to end.
Thankz so much..
|
|
|
|
|
paulcortez wrote: Code was supposed to be MessageBox.Show(strTest.SubString(2, 3)); right?
Second parameter is number of characters in the string you want to display. If you want to display the last two characters in the string, leave off the second parameter.
If you need to display a certain number of characters starting at 2 and you want to be sure it doesn't hit the out of range check the starting character plus number of chars you want to display against the strTest.Length value. If the starting plus number to display exceeds length, then you're out of bounds.
Mike Poz
|
|
|
|
|
Guys,,,
Thank you so much. Now I understand that the second parameter is the lenght, not the position of the character where you want to end.
Thankz so much..
|
|
|
|
|
public string Substring(
int startIndex,
int length
);
damianbc
|
|
|
|
|
Specified cast is not valid.
(InvallidCastException)
i'm unable to correct this, so that report is displayed. If anybody have any idea about it, please help me.
thanks.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
uroojkhan wrote: Specified cast is not valid.
(InvallidCastException)
i'm unable to correct this, so that report is displayed. If anybody have any idea about it, please help me.
Well posting the line of code that throws the exeception might be a good start.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Michael P Butler wrote: Well posting the line of code that throws the exeception might be a good start.
Thanks for comments.
Well i'm not new to crystal report, but yes new to C#.net.
I created a report but after alot of tries i'm unable to add/include/embed/integrate (what ever you call it) with my c# project.
I just asked the suggestion or guideline (if someone have). If you don't have then don't bother yourself.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
uroojkhan wrote: Thanks for comments.
Well i'm not new to crystal report, but yes new to C#.net.
I created a report but after alot of tries i'm unable to add/include/embed/integrate (what ever you call it) with my c# project.
I just asked the suggestion or guideline (if someone have). If you don't have then don't bother yourself.
Unless you can post more detailed information, then we won't be able to help or suggest solutions.
Sorry if my original reply sounded off-hand. From your original post, it sounded like you had code for showing the report which as throwing an exception.
A quick google will produce lots of C# examples on using Crystal Reports. MSDN has some good samples as does the BusinessObjects web-page.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|