|
What error are you getting and what line causes it?
Side note: try doc.Load(C_strFileName);
|
|
|
|
|
This is the line the error is in now
root.ReplaceChild(newDayIndex, oldIndex);
The Error message is a NULL reference Exception now after changing my doc.Load to what you suggested
|
|
|
|
|
Well you don't test for null after
oldIndex = root.SelectSingleNode("/config/Days_Index");
|
|
|
|
|
I realize that but if i check for null that does not fix my problem that just fixes the run time error, I need to figure out why it is not finding Days_Index in my XML file
|
|
|
|
|
Oh, so you know it's not finding Days_Index, why didn't you say that?
Could you post a snippet of the XML file and repost the code as it stands now?
P.S. Just a guess, in "/config/Days_Index" , should config be capitalized?
|
|
|
|
|
i'm new to silverlight, in new i mean i have never even used it. before i go through the trouble of learning it i need to know:
i (currently) use flash and java, connected through an xmlsocket for a desktop app. i need to be able to do the same in silverlight c#.
can silverlight connect to a c# class that implements an xmlsocket type connection, and can the data be sent back to silverlight?
can silverlight be run as a standalone application in a player like flash? or is it only browser based at the moment?
rather have something you don't need, than need something you don't have
|
|
|
|
|
silverlight is WPF/E, right ? So, it's a framework on top of C#. Silverlight is a cut down version of WPF, WPF writes complete apps. I can't see how it could be more than trivial to create an app that is a viewer, even if it's just a web browser control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi!
my problem is that i try to input string containing ' char into filter statement which causes an System.Data.SyntaxErrorException is thrown..
<br />
string str1 = "aaaa";<br />
string str1 = "aa'aa";<br />
<br />
bs.Filter = string.Format("val1 like '{1}' and val2 like '{2}'", str1, str2);<br />
outcome would be: bs.Filter = "val1 like 'aaaa' and val2 like 'aa'aa'";
thanks for any help!!!
life is study!!!
|
|
|
|
|
1. string.Format("val1 like '{1}' and val2 like '{2}'", str1, str2);
Should be string.Format("val1 like '{0}' and val2 like '{1}'", str1, str2);
2. aa'aa should be aa''aa becuase filter behaves same way as a stored procedure would behave.
|
|
|
|
|
hi
i want to bind my treeView to my database,for show Hierarchy data, how to do ?
thanks
|
|
|
|
|
I don't think you can, but I've never tried to.
I simply make a bunch of queries and populate the TreeView the hard way, but part of that is due to the complexity of the data.
|
|
|
|
|
I have an event that needs to occur every time a file containing records is imported, I keep getting an exception at this line:
OnImportFile(this, new ImportFileEventArgs(fi.Length, i, fi[i].Name));
The exception is "Object reference not set to an instance of an object."
I have check to make sure none of my variables are Null, I don't know what the deal is. Suggestions Please?
J.Perez
|
|
|
|
|
Justin Perez wrote: I have check to make sure none of my variables are Null, I don't know what the deal is.
You just explained what the deal is, then you tell us you don't know what the deal is.
Perhaps you are not explaining yourself very well.
Justin Perez wrote: OnImportFile(this, new ImportFileEventArgs(fi.Length, i, fi[i].Name));
TIP: Don't put all this stuff in one line of code. It makes the code difficult to read, and difficult to debug.
Change it to:
int length = fi.Length;
FIClassName currentFI = fi[i];
string fiName = currentFI.Name;
ImportFileEventArgs(length, i, fiName);
That makes it a lot easier to debug and step through and see where all the values are and how it is being built up.
|
|
|
|
|
Is anything actually assigned to handle the OnImportFile?
someObject.OnImportFile+= new OnImportFileEvent(someHandler);
If not, you will get an exception Take this example code
<br />
class Program {<br />
static void Main(string[] args) {<br />
someClass obj = new someClass();<br />
obj.RaiseEvent();<br />
obj.someEvent += new someClass.SomeEvent(EventHandler);<br />
obj.RaiseEvent();<br />
}<br />
static void EventHandler(object sender, EventArgs e) {<br />
<br />
}<br />
}<br />
class someClass {<br />
public delegate void SomeEvent(object sender, EventArgs args);<br />
<br />
public SomeEvent someEvent;<br />
<br />
public void RaiseEvent() {<br />
someEvent(this,new EventArgs());<br />
}<br />
}
You can resolve this by testing someEvent for null
<br />
public void RaiseEvent() {<br />
if(someEvent!=null)<br />
someEvent(this,new EventArgs());<br />
}<br />
or setting it to have at least one handler when you create the object
<br />
class someClass {<br />
public delegate void SomeEvent(object sender, EventArgs args);<br />
<br />
public SomeEvent someEvent;<br />
someClass{<br />
someEvent+=new SomeEvent(internalHandler);<br />
}<br />
private void internalHandler(object sender, EventArgs e) {}<br />
public void RaiseEvent() {<br />
someEvent(this,new EventArgs());<br />
}<br />
}
I usually test for null, but either works.
|
|
|
|
|
bearfx wrote: Is anything actually assigned to handle the OnImportFile?
someObject.OnImportFile+= new OnImportFileEvent(someHandler);
I didn't not have anything assigned to handle OnImportFile. I am new to events so bear with me here Below is my delegate and event in my class.
public delegate void GNISImportFileEventHandler(object sender, ImportFileEventArgs e);
public event GNISImportFileEventHandler OnImportFile;
So to assign something on handle OnImportFile I have this:
OnImportFile += new GNISImportFileEventHandler(OnImportFile);
From the articles I have been reading that should do the trick, but I get the exception "Delegate to an instance method cannot have null 'this'." A article that covers this issue would be greatly appreciated.
|
|
|
|
|
How do I disable the Next button on the Custom Setup screen if no features is selected?
thanks !!!
|
|
|
|
|
Have a look at Enabled property of a button
|
|
|
|
|
omg,
where is it?
i cant find...
|
|
|
|
|
|
Hello there
I've put dataGridView control on the Form and i've written this code:
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
dataGridView1.Columns.Add("Main", "Main");<br />
dataGridView1.Rows.Add(3);<br />
<br />
dataGridView1[0, 0].Value = "A";<br />
dataGridView1[0, 1].Value = "B";<br />
dataGridView1[0, 2].Value = "F";<br />
dataGridView1[0, 3].Value = "ABC";<br />
}
So, when i try to sort it (clicking on the header of the table) - the last row ("ABC") is every time the last
You can go a long way with a smile. You can go a lot farther with a smile and a gun. (C) Al Capone
|
|
|
|
|
Hi,
Make number of row 1 more then acutal rows.
dataGridView1.Rows.Add(4)
I think internally it take the last rows as newRow and doesnot considers while sorting.
Hope this helps.
Regards,
Anil Ch
|
|
|
|
|
Hello everyone,
The Windows Application that I am working on requires displaying some data which are stored in a remote database server. The user can get connect and import the data into the application and then get disconnected and continue working. The Windows Application requires having similar ability to the database server as it needs to run queries on the Data.
I have tried the following approaches and ended up with some problems.
The first approach was to load the data into a DataGrid and then use filters on the DataSet to run queries. Unfortunately, I need to display the filtered data in different manner than DataGrid and I was unable to do so. I need to display the filtered data in number of TextBoxs and not in the DataGrid. Sadly, I was not able to do so unless I am missing something here!
The second approach was to download the data into a CSV file and then use combination of StreamReader and StreamWriter to run query on the CSV file and achieve what is needed. Sadly, the speed that I can run query is very much dependent on the size of the CSV file. Unless I am missing something here too!
My question is, what is the best way to import data from a remote database server and have the ability to run query and display the result in a fashion that I desire (in various TextBox)?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Do you need to have the data imported from SQL server accessable only in the active session or have them for later processing too?
In first case you can store the data in a DataTable object (in memory), apply filters on it and take out any data from the Rows[ItemNo] object to feel your TextBoxes.
In the second case you can establish connection to some local data store like FoxPro dbf files or Access mdb, store your data there and then use all index search advantages to execute your tasks.
Tell me, why do you need to process data offline?
|
|
|
|
|
the code of Ant on a Chessboard please...
|
|
|
|
|
Write it yourself, or Google for it. All you have to do is type "ant on a chessboard" into the search box.
If you wanted help writing it yourself, ask specific questions about where you're getting stuck. Just comming here asking for the code will only be met by replies with a flamethrower.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|