|
I have a form with a number of user controls on, however the form seems to keep corrupting. I don’t have the problem with any forms that don’t have user controls, and another dev here has the same problems on another app (different user controls as well).
This is the error that I get when I try to load the form in the designer
http://img157.imageshack.us/my.php?image=formerroruu9.jpg
Any suggestions
I am using VS 2005
-- modified at 4:55 Wednesday 14th February, 2007
|
|
|
|
|
Hello,
The designer calls the Constructor and also the setters of properties if they are set, from your usercontrol.
In your case you whant to access an object wich is not created (instanziated) yet, therefore you get this null ref Exception.
You first have to find the point in the usercontrol where the exception is thrown:
You could start a second instance of your project and then connect at youre first instance.
After that you should set a breakpoint in your controls constructor, and then open the form (designer) in the first project.
Or go threw the code and look for unsafe code (like access without a != null if statement).
Once you find your problem please don't use the "DesignMode" property (like some programers would recommend) as a workaround, make it run by changing maybe the design or use an if statement.
Hope that helps!
All the best,
Martin
|
|
|
|
|
Thanks for your reply,
Firstly can you explain how i do this i a little more detail
"You could start a second instance of your project and then connect at youre first instance.
After that you should set a breakpoint in your controls constructor, and then open the form (designer) in the first project."
secondally, one minuate that project is fine then, i rebuild it and it breaks, why would it not be consistant?
Thanks
Mark
|
|
|
|
|
|
Thanks, Have sorted my app
|
|
|
|
|
Hi friends,
I want to run sql server 2000 script (abc.sql) file from my C# application.
Can you guide me??
Regards,
Sushant Duggal.
|
|
|
|
|
read it as textfile than paste content of it in SqlDataAdapter or SqlCommand or in SqlDataSource
I Love SQL
|
|
|
|
|
I would suggest that you look at using Process.Start to run osql.exe .
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete,
Thanks for your post. Can you tell me after starting the osql process, what I need to do.
Regards,
Sushant Duggal.
|
|
|
|
|
Sushant Duggal wrote: Can you guide me??
You can run just about any SQL through a SqlCommand . Just read the file in to a string and dump the string into the SqlCommand .
NOTE: GO is not SQL. It is a preprocessor command to Query Analyzer to tell it to split the file into batches. If your file has GO s in it, you need to split it up and send them as separate SqlCommand s.
|
|
|
|
|
Thanks for the reply friends.
Regards,
Sushant Duggal.
|
|
|
|
|
<code>ResultForm.richTextBox1.Text += "Return Result # " + (beginResultPage + i + 1).ToString() + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].snippet + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].URL + "\r\r";
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("<b>", "");
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("</b>", "");
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("<br>", " ");</code>
Hi
reading from the codes above, i want to <b>bold</b> some of the results that is recieved through the richTextBox control in the form.
For eg, if i want to make bold the title that is produced using this line of code,
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";
What do i need to add in to ensure that the results is in bold?
frossie
|
|
|
|
|
how can i get value from a string variable into a textbox?
if (dr.Read() || checkBox1.Checked == true && tb_id.Text == "@ploginname")
{
string strpwd = (string)dr["loginpswd"];
//MessageBox.Show(strpwd);
}
i m saving 'loginpswd' from db into strpwd variable. it is coming properly.
now how can i get value of 'strpwd' into displayed into textbox2?
hoping to get a reply.
thank you.
nekshan.
|
|
|
|
|
textbox2.text = strpwd
Cheers
Navaneeth!!
|
|
|
|
|
|
|
thanx virendra.
whts up? hope to complete dis module in dis week.lets c.
cu soon. tc.
nekshan.
|
|
|
|
|
i m working on xmlwebservices.i have to prepared 3 webservices in 2 days..
|
|
|
|
|
hi
i sucessfully send or rteceive data to parallel port in windows 98
but i cant communicate parallel port in windows XP
|
|
|
|
|
I've never tryed but I think you can find your answere here
|
|
|
|
|
I have a class A and within this class A, I want to have an object of type A. Is this possible ? Do I need to do anything special ?
|
|
|
|
|
i think u can do that
Cheers
Navaneeth!!
|
|
|
|
|
|
Hello,
It's working as long as you not calling " ??? = new A();".
Then you would have a invinit loop!
All the best,
Martin
|
|
|
|
|
I understand..I will not need to do that !
|
|
|
|