|
Ed.Poore wrote: How about defining an "example" function which is displayed when being designed?
I thought that was what my default constructor was doing and it does work when you initially drag the control on to a form, but if you change any of the properties of the control it adds that line to the InitializeComponents method that seem to cause all the problems.
|
|
|
|
|
I just had a thought, take a look at the DesignerSerializationVisibility with a value Hidden . If you apply this to your property (hopefully) the designer will not generate code for that property.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed.Poore wrote: DesignerSerializationVisibility with a value Hidden
That fixed it! Excellent, thank you.
|
|
|
|
|
Now if only I can fix my designer problems...
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Hi!
I have the silliest problem - how do I test a connection string? That is, I have a server name, username and password, and database name. How can I test that specified database exists on specified server with the specified sa account?
My first thought was to build a SqlConnection object, try to open it, and if it throws an exception, that means that it 'failed the test'... But there must be some other way to do this, without throwing exceptions... right?
Thanks,
Aleksandra
|
|
|
|
|
When creating (if you do) the connection string in VS there's a button somewhere which says "Test Connection"
Although it probably does what you were thinking of doing anyway
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed, I have to test the connection programatically... I know that there is a button Test connection when you create a connection from VS... Let me explain: I have a form with the following textboxes: server name, username, password, database. When the user enters that data, I have to check that connection - that it really exists... My question is this: is there some other way (some built-in mechanism or something) of doing that than just creating a conenction string, creating a connection object, and waiting to see whether the open() method will throw an exception...
|
|
|
|
|
I think the only way is to trap any exceptions thrown by the Open method, I don't know and cannot see of any other way.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
The only other way I can think of is open a connection the server and query the system tables for the database in question. This is of course not a very good option as it requires a higher level of credentials and the storage of two connection strings.
only two letters away from being an asset
|
|
|
|
|
Well, I'll try something Thanks for the reply
|
|
|
|
|
I have created a C# windows forms app.
On a certain click event I perform a console.writeline("Message Text").
The program buils fine, and runs without an error, but I don't get to see any output in a console window.
What must I do to see the output?
|
|
|
|
|
Do you use Visual Studio as your IDE ?
When you create a new Console Application, then you will get an empty Main method.
Just type : Console.WriteLine("Message Text");
It will show "Message Text" in ConsoleApplication.
|
|
|
|
|
there is an output window (in the menu -> view -> Output).
It should come in there somewhere. (note that other stuff comes in there is well.)
you could do this to filter a bit:
<br />
console.writeline("");<br />
console.writeline("Message Text");<br />
console.writeline("");<br /> which will write an empty line before and after your text.
Good luck.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
|
You can change the executable to compile as a Console App, nothing stops you from displaying Windows Forms. The only difference is, is that a Console is displayed if not run from a console. If this is only temporary for debugging purposes then you can change it back to a "Windows Forms" project when building for release.
You can also run it from the command-line without having to compile it as a Console Application and that will display the information (basically the Output window mentioned above does exactly this).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I have a stored procedure that returns XML using FOR XML AUTO ELEMENTS, but there is no root element in the returned value.
I feel this may be the source of some errors im getting when trying to load the returned value into an XMLDataDocument.
Whats the best way to get a "root" element to ecapsulate the data?
Is there a way to make it return the results with a root? or a simeple way to add one to the datadocument in preperation before placing the returned value into it?
Thanks.
|
|
|
|
|
You might be able to create a XmlDocument with a base root and then set the roots innerXml to your xmldata.
Something like:
<br />
XmlDocument xmlDoc = new XmlDocument();<br />
<br />
xmlDoc.LoadXml("<root></root>");<br />
<br />
XmlNode root = xmlDoc.DocumentElement;<br />
<br />
root.InnerXml = your_xml_data;<br />
Not sure if this will work on first try. Havent got a compiler here but I've
set node.InnerXml successfully before.
Hope it works for you.
-Larantz-
For those about to code, we salute you.
|
|
|
|
|
Python has library 'difflib' which can be used to find coincidence percent between two sequences (strings). I am looking for the way to do the same (compare 2 strings) within .net platform.
So what is the name for an algorithm I am looking for? And where to look for it?
|
|
|
|
|
How can I print to the printer some text and increment any time I print
more text.
my code:
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
ePrint.Graphics.PageUnit = System.Drawing.GraphicsUnit.Millimeter;
// this go to metoda and return an object PrintPageEventArgs e
MiddleTable mTable = new MiddleTable(e);
mTable.PrintMiddleTable();
TopTable tTable = new TopTable(e)
tTable.PrintMiddleTable();
}
/////////////////
This is the code that will be printing in any page
I want to put him (e) in an obj - because it will be not change.
but when I print I whant to take this obj and add to him another text
I want that the code will not repeat on top will not repeat.
|
|
|
|
|
Hello everyone,
My problem is that I want to -simply- write selected images to CD/DVD in my app.. I searched for the xp burn area but found nothing (you know, you can say "burn this" to any folder and XP copy this file/folder to a burn area)..
Also the nero sdk may be too complicated..
What can I do to accomplish this task
Best regards..
.:: Something is Wrong ::.
|
|
|
|
|
Would someone please help me with this problem:
I have an expando on my MainForm that takes care of my menu, and I also have a MenuBar on the same form that also provides shortcuts to the items in the expando. After using the expando for a while, I then use the MenuBar and then suddenly my system crashes and an error: "Handle is not initialized " appears. (The expando and MenuBar sometimes call DataSets)
Mvelo Walaza
Visual C# Programmer
Nelson Mandela Metropolitan University
Port Elizabeth, South Africa
+27 729264095
|
|
|
|
|
What do your try catch blocks have to say about the whole thing?
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
What is the code to find out the number of pixels contained in an image and what is the code needed to draw a histogram.
tony-yeyo
|
|
|
|
|
diddy34 wrote: What is the code to find out the number of pixels contained in an image
width * height
diddy34 wrote: and what is the code needed to draw a histogram
Loop through the pixels, calculate the value that you want the histogram for (for an example intensity), and count how many there are of each value. Draw a diagram from the count.
---
b { font-weight: normal; }
|
|
|
|
|
Simple counts don't graph nicely :p
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|