|
Hmm, what does the debugger show if you break into the GUI thread and type System.Threading.Thread.CurrentThread.ApartmentState at the Watch window?
COM apartment state can be set only once per thread, so if someone (VS?) sets the apartment to something else, the STAAttribute won't help.
|
|
|
|
|
As mentioned in the post below, I was able to make the problem go away by reverting to an earlier version. Thanks for the suggestion, though.
|
|
|
|
|
"Solved" the problem by reverting to an earlier version, before the bug appeared, then copying the changed source files over the earlier version to update. The problem disappeared. I'll probably never know what caused it.
|
|
|
|
|
I couldn't connect to a named instance of SQL 2005 the last few days from VS2005. I tried everything but failed ("Instance Failure"). Today, I simply changed the Data Provider from SQL Server to OLE DB and it worked.
Any idea how I can fix this problem. I have many applications which are using SQL Server as the provider and changing them is not an option--at least if there is another option.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
It was working and then just stopped? You really want to use the SqlServer data provider rather than that OLE DB thing provider when using SQL server if you can.
Sorry if I'm stating the obvious, but have you definitely got the connection string correct?
Regards,
Rob Philpott.
|
|
|
|
|
Yes, connection string is definitely correct because it used to work but after DBAs installed SQL Server, the applications stopped working.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Have you checked all the appropriate protocols are open in the configuration manager?
Regards,
Rob Philpott.
|
|
|
|
|
Here you go:
Name:Order:Enabled
Shared Memory:1:Enabled
TCP/IP:2:Enabled
Named Pipes:3:Enabled
VIA::Disabled
Everything enabled except for VIA.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
I've run out of ideas then. The named instance hasn't changed?
Regards,
Rob Philpott.
|
|
|
|
|
No.
I don't understand why VS2005 can connect using OLE DB but not SQL as Data Provider. This is where the problem resides: If we can figure out why one works and the other does not.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Solved!!!!
Default instance and named instance were both listening on the same port number. I asked the DBAs to change the port number of the named instance to a different port and all is fine now.
Shouldn't the DBA's fix this? They kept saying it is my applications.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hallo,
I'm looking for a way to read the table of contents of an ms word document and load it in a richtextbox, with c# and visual studio 2005. Is there a way to make it linkable (if someone klicks on it, it takes you to the specific page)???
If it's not possible with a richtextbox, is there any other tool that can do it??
Thanks!!
|
|
|
|
|
Hi,
I had an application of BHO, which is created using c#.
this had been performing well on IE6. But The Setsite() not called? what may be the problem.?
|
|
|
|
|
Hi Guys,
Quick question : I have 2 forms : FORM1 and FORM2. In FORM1 i am trying to implemen a PRINT PREVIW button to work like the PRINT PREVIW button in FORM2.
Here is the delegate, event Starter() and Subscriber() lines.
public delegate void DelegatPrintPreview(object sender, EventArgs e);
public static event DelegatPrintPreview EvenimentDelegatPrintPreview;
public static void StarterPrintPreview(object o, EventArgs ev)
{
if (EvenimentDelegatPrintPreview != null)
{
EvenimentDelegatPrintPreview(o, ev);
}
}
public static void SubscribeToPrintPreview(DelegatPrintPreview pf)
{
EvenimentDelegatPrintPreview += new DelegatPrintPreview(pf);
}
the question is : Where do i put the delegate(in the form with the same button or the other one )? and the same question with the Starter() and Subscriber() methods ?
Regards,
Alex
“Be the change you want to see in the world.”
|
|
|
|
|
Firstly, you don't need to define that delegate. The EventHandler delegate has the same signature.
http://msdn.microsoft.com/en-us/library/system.eventhandler.aspx[^]
You'd want to stick your event handler in both forms, and implement each seperately. If they share the same code, put that in a common function and call that from both handlers.
Regards,
Rob Philpott.
|
|
|
|
|
10x for the advice Rob. My delegate works just as it is. The issue is that Form1 is the first that starts when i run the program . In form 2 i have the button to print ( with the code). To avoid copying the same code in Form1, i wanted to create a delegate. So i created it in Form2 and also subscribed the print preview method to in in Form2. I made it but it only works when i start Fom1 and then start form2 and close it. Then i can use the button in Form1 for print preview.
This is because when i use the starter method in Form1 for the button in the Menu Strip i run it like this :
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2.StarterPrintPreview(sender, e);
}
So it needs form2 started once in order to run...and i am struggling with this to make it work
PS:I declared the Methods in Form2 STATIC but i can't see them in form1.i need to call them using FORM2
“Be the change you want to see in the world.”
|
|
|
|
|
al3xutzu00 wrote: I declared the Methods in Form2 STATIC but i can't see them in form1
Did you make them public/internal?
If the code doesn't logically belong to Form2, how about having a separate static class that has the common code?
|
|
|
|
|
I'm very much with Senthil's comments above. You really don't want some common functionality in form code. Otherwise, as your experiencing you need to create form2 in order to do print preview in form1. form2 has obviously got massive amounts of GUI stuff in it which you don't need or want.
Try and abstract out the preview functionality into another class and call that from both.
Regards,
Rob Philpott.
|
|
|
|
|
Hi experts,
In my c#.net 3.5 windows application i added a set up project to my solution.
It is installing and running fine but i want to edit those install wizards means i have to display my company icon, few logos on that wizard.how to do that?
is it possible?
please share some knowledge and ideas to solve this.
Thanks in Advance.
--Naren
|
|
|
|
|
You'll need a third party installer tool to do this, such as InnoSetup, InstallShield, Wise Package Studio, .... The setup project that's in Visual Studio is a very basic one and doesn't lend itself to customization very well.
|
|
|
|
|
Thankyou dave sir,
actually first i made my setup file with .net system defined wizards only. but higher authority want me to change those wizards with our company logo,....
using installshield we can achieve this?
actualy am very new to deployment.
Thankyou very much.
|
|
|
|
|
Wait, wait, wait.... Are you saying that you still want (can) use the Setup and Deployment Wizard to generate the MSI installer, but you want to change the images in the template used to generate the MSI project?? So, all future uses of the Setup and Deployment Wizard will generate an MSI with your company logo??
|
|
|
|
|
Can we change the shape of button from Square to any other
i want to make my project attractive by changing the shape of windows button in c# net
|
|
|
|
|
Underneath all the hoohaa of buttons, they are just two pictures - one up and one down. So it depends on exactly you want to do.
You can create your own user control that mimicks the button behaviour, but is shapped any way you please. A quick google should give you some help on irregular shapped controls.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
HI There is not a simple way to create a button for that you just use a picture box and use image for it
|
|
|
|