|
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 [^]
|
|
|
|
|
Hi,
Before the post, I also tried MSDN examples exactly in the same way. Now I think, there might be some problem in my current softwares installation, or (as sounds from my collegues) there might be less support in visual C# 2005 Express Edition. Well i'll try it later again.
I'm Sorry too because of my last day harshness.In fact this problem make me too tired (+ some other reasons too).
Well Best Regards.
Urooj Khan
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
This is simple, i wont to insert into a database some values, here is the code:
private void insertToDB(SQLConnection conn)<br />
{<br />
String sql = "";<br />
SqlCommand command;<br />
<br />
try<br />
{<br />
conn.Open(); <br />
<br />
foreach (customerGroup group in customerGroups)<br />
{<br />
command = null;<br />
sql = "INSERT " + group.getID() + ", '" + group.getGroupName() +"', " + group.getGroupParentID() + ", " + group.getLevel() + " INTO [custGroups]";<br />
command = new SqlCommand(sql, conn);<br />
command.BeginExecuteNonQuery(); <br />
} <br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
throw ex;<br />
}<br />
finally<br />
{<br />
conn.Close();<br />
}<br />
<br />
}
My connectionstring is:
Server=XXX\YYY;Database=ValkyriaDB;User ID=XXX;Password=YYY;Trusted_Connection=False;Asynchronous Processing=True;
(sorry about the smile but i did not know how to disable them)
My first question is that one running this it throws exception that i must enable Asynchronous Processing in my connection string, why is this?
Ok, so i enabled it. What happens, it throws a new exception connection does not support MultipleActiveResultset series.
So could somebody help me with this, because i simply dont understand. Im a java programmer and the above code is identical to my java code except for that i use prepered statements i the loop. If there is a better and easier way to do this please also tell me.
Johan
-- modified at 7:57 Monday 26th June, 2006
|
|
|
|
|
|
Hello all,
i am using asp.net 1.1. I want to disable the Browser back functionality means when clicking on back button it should not be goes back.
how to do this.
plz help me
regards
GV Ramana
|
|
|
|
|
Are you talking the desktop browser or a browser in your own application?
If you mean in you own application, the way to prevent GoBack() from everworking would be to clear your browser object's history after each navigate completes. Unfortunately I haven't found a way to do that and I can't find any codeproject articles or when searching MSDN, searching with Google and searching with MSN search that explain how to do it.
My quick and dirty suggestion would be to not implement/expose that functionality by leaving off the "back" button in your application. Additionally, since you cannot go back, it would make no sense to implement a "forward" button either. Unfortunately that leaves open the possibility that the user will use the backspace button while the focus is on the browser window and not in an editable field which would most likely cause a GoBack() to occur.
Sorry, best I can do for you.
Mike Poz
|
|
|
|
|
Hello all,
for asp.net 1.1 project, i have oracle 9i client. Using 9i client i am able to access the clinet. but with asp.net application it is giving following error
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
i am given permissions to ora92 folder. still it is givng same problem
any solution.
regards
GV Ramana
|
|
|
|
|