|
I haven't done it myself, so I don't really have any input on it.
search for "c# activex"[^]
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hello friends,
I am developing an windows application and making connection string in APP.config file like this:
<configuration>
<appsettings>
<add key="ChatConnectionString">
value="Data Source=sql.xyz.com; Initial Catalog =mydatabase; uid=xyz; pwd=xyz;"/>
now i am using this connction string in my application like this:
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationSettings.AppSettings["ChatConnectionString"];
but ist showing an error that "THE ConnectionString property has not been initialized"
Please giv me any appropriate solution
|
|
|
|
|
is the "key"-attribute in your config file "ChatConnectionString" ?
|
|
|
|
|
Hi Guy
In your above code have two possiblity for that error will come
1.Your connection string not in AppSettings Tag in App.Config
2.if Connectionstring with in the AppSettings, key name will be wrong.
So Check those two and call correct way.
if you connectingstring in ConnectionString Tag in AppConfig.config file, u must call like this.
ConfigurationManager.ConnectionString["KeyName"];
or ur way is right.
check those two possiblity and change your code and run.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
I'm using VS2005. This happens only sometimes.
If I block a code using mouse, then press Ctrl-X to cut it,
it crash my VS2005. I must restart it. After restarting it,
my VS2005 going normal again.
Anybody have the same problem ?
|
|
|
|
|
Nope, and I've used it every day for 3 years now.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
possibly a source control issue?
|
|
|
|
|
Hi
I have 2 algorithms that I want to compare (in terms of raw execution speed). Although I have already checked the theoretical difference (O-notation) I would also like practical results since each statement may influence the run-time in a way that theoretical techniques can not identify as easily.
So my question is: How can I most accurately benchmark the run-time of a code snippet? I did this in C++ once with a library called miracle and there it was just a matter of storing the time before execution and after execution and then subtract, however I do not know C#'s capabilities for reliable and accurate results.
Any thoughts would be appreciated.
|
|
|
|
|
Hi,
the programming language is not relevant in this issue.
and you don't need any special tools for measuring performance; one or a couple of
test cases, ran on an otherwise quiet system, will allow you to measure elapsed
time with a stopwatch, or a built-in function, based on a system timer.
If the timespans are below say 0.3 seconds, you should be careful (see my timer
article). It does not hurt to do the entire measurement in a loop (say 10 times)
to observe variance; don't be surprised if the first try is slower (e.g. due to
JIT compiler effects, or memory initialization).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
So does .NET have any high resolution/accuracy timers for this purpose that I can use?
Using a manual stopwatch is out of the question because that will be waaay to prone for human error.
|
|
|
|
|
This Stopwatch[^]
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Sweet. That was exactly what I was looking for!
|
|
|
|
|
Hi,
i am developing Windows Custom Control. For a property, I am developing a rich Windows GUI property builder. My question is, WILL THE DESIGN TIME GUI CAUSE MORE LOADING TIME FOR THE RUN MODE ?
|
|
|
|
|
HI Guy
may be possbile, becuase of your pc may be slow, and you had add many control in your custom controls. so that's not most issue man in for controls. bescailly u can see this is behaviour in windows GridView control also.
so dont worry do more.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Hi all,
I want to put some info into a RichTextBox (or whichever other control might serve the purpose better) consisting of different sections. I was hoping to put a horizontal seperator between sections but I'm not sure how to do that. I'm probably missing something very simple here.
I'm thinking of something similar to the tag of HTML. Any ideas?
Thanks in advance
Dewald
|
|
|
|
|
Use SplitContainer then put 2 RichTextBox in each panel.
|
|
|
|
|
Thanks, that would be an idea but I will be adding text (in various sections) at runtime and will not know beforehand how many sections (and horizontal seperators) there will evetually be. So it is important that I am able to add seperators at runtime.
|
|
|
|
|
No, a richtextbox (as it is) cannot be split. But you may have a control, which consists of two richtextboxes and a seperator between them. You may program different interactions between these two controls to give the user the feel that they are one split richtextbox (if you need such thing).
|
|
|
|
|
Thanks, but just to be clear, I'm not looking for a split-line (or whatever you call it) with which the sections can be resized etc. I want to simly draw a horizontal black line across the width of the control and continue with more text under that.
The easiest way would be to add a bunch of underscores or minusses to the textbox but I was hoping for something more elegant.
|
|
|
|
|
Hi,
I have not done this myself, but it sounds like you want a ListBox (great at holding
a number of items of any kind), where each item could be a RichTextBox.
Make it UserDrawn and you can add RTB's as much as you want, they will be layed ou
one below the other, and scrolling will be automatic.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hey, I think you may be on to something. I'll try this out and report back. Thanks.
|
|
|
|
|
Good idea Luc - interesting concept. I can imagine this being extremely usefull in lots of situations.
Dewald - post back if you get it to work (maybe with a little code snippet?). This is going on my todo list for when I get a little time
Dave
|
|
|
|
|
OK, I'm making progress but it's painfully slow. Was hoping someone could give me a nudge in the right direction.
I'm at the point now where I'm trying to paint the RichTextBox in the ListBox (in the DrawItem event of course).
The nearest I've come so far is to use the e.Graphics.DrawImage() method but obtaining an Image of the RichTextBox is proving tricky. I'm sure there has to be a better way than importing the gdi32.dll and bit blasting the control onto an image (as explained here[^]) which is then drawn into the ListBox.
Any ideas?
|
|
|
|
|
Why not use the Web Browser component in edit mode?
|
|
|
|
|
Hi all,
I wish to add line numbers next to a Listview control.
I don't want this line numbers to be the first Listview column, but a different control next to it.
I thought of using a simple Textbox, but I can't find convenient way to synchronize between the Listview lines and the Textbox lines (Height and location).
Does anyone have an idea? Maybe a different control?
Thanks a lot,
Eyal.
|
|
|
|