|
If i write as follows,
string constring=@"source, user=,password= ";
SQLConnection con=new SqlConnection(cosnstring);
still am getting an error.
|
|
|
|
|
This may seem like a stupid question, but which database engine are you using? SQL Server, MySQL, Access, Oracle, ... ?
You can find the correct format for your connection string at http://www.connectionstrings.com[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
That doesn't look like a valid connection string to me.
Did you post the actual code in the first instance ? Or did you change it in other ways ? This does not account for your actual error, really, which makes no sense to me, right now.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ya, thank you all,
i modified wrongly.
I got the problem, the problem is with declaring the declaration of string.
|
|
|
|
|
Just remove the @ character
Dabsukol
|
|
|
|
|
I have problem I use Northwind database to build some prototype application in C#.
Thing is when I set on Orders to display me EployeeID and CustomerID as listbox, I can select data source so they show only Name instead of ID, but Value is indeed ID of those 2.
However when I do this Datanavigator have no effect on those 2?
Wonder why since doing same thign on column in data grid work just fine.
Any idea?
Not exactly ado question I guess so I hope it's right room...
|
|
|
|
|
hello guys
i want to use my gprs modem /wirelsess card attatched on my pcmci throug my c# application,
means i want send and receive sms based on my business logic through this application ,,
any idea where to start ,, have any one done that before ,,
any help will be highly appreciated ,,
thanks in advance
hello
|
|
|
|
|
AFAIK you can talk to it like a normal modem.
Did you try Google, it turned up this[^] as my first result for my first search.
|
|
|
|
|
Hi!
I want to draw some semi-transparent rectangles over special regions of a richtextbox.
So I hook up in the DefWndProc of an inherited RichTextBox class.
This looks like this:
protected override void DefWndProc(ref Message m)
{
base.DefWndProc (ref m);
switch (m.Msg)
{
case WM_PAINT:
MyPaint();
break;
}
}
In MyPaint() I draw onto the richtextbox with a rectangle. This all works fine.
But when I start clicking into the richtextbox my rectangles becomes more and more "solid" (cumulating alpha channels I suppose)... What can I do to fix that? If I minimize the form and maximize it again, everything's fine again.
It really seems to me, that the richtextbox fires WM_PAINT messages too often without clearing the screen...
Clearing the richtextbox with Graphics.clear() or UserPaint is not a real option for me... I do not want to paint everything by myself. I also tried to capture the bitmap of this part of the screen and draw that (by clearing the screen after capturing the image). But I end up with the same problem.
I also tried to use the captured image to check if pixels are white or have some other color. Due to some (unknown) reason, that did not work out (though I could save that bitmap and it seems to show the right portion of the screen (and I was looking at the right pixels)
But I hope that there's an easier solution.
Cheers and thx for all help!
|
|
|
|
|
Hi,
While searching for the same functionality, I found your message. Please respond, if you find solution to draw semi-transparent rectangles in RichTextbox. Thanks in advance.
|
|
|
|
|
Hi there!
This is quite old If I remember correctly, I did use the back color drawing of the richttextbox for a while. But when I realized that things became too slow and all my colored boxes in the rtf where flickering (I needed to repaint boxes where the user dragged the mouse over) I finally made up a richtextbox myself. In the end this was the best decision for me and even did not took too much time (maybe because I did soo many different things with the rtf that writing your own was easy then). With my own kind of rtf I finally could draw everything the way I wanted (using GDI+) and it now works fine and fast (much faster than the rtf) with no flickering at all (even if I heavily use boxes and alike).
I am sorry but I cannot post any code here, as this rtf was part of a business work and I sold it, thus this wouldn't be okay to do so. And the code for this is also quite specific and it is much code.
But if you want to do something special with rtfs think about doing it all yourself. As I said, it took me less time doing it myself, than trying to get the rtf to do what I wanted. (Of course this depends on what you want to do with the rtf).
Hope this will help you a bit.
Cheers
|
|
|
|
|
i know this is a c# forum but couldn't find one vb. if i get a sample how to it in C# no prob i can convert it
Default using vb.net to post to a website
i want to post a string to a website can anyone show me or point me to example of how you would use vb.net to post a string to a website and accept the response sent back from post / request to the site?
|
|
|
|
|
keroed_edmond wrote: i know this is a c# forum but couldn't find one vb.
The Code Project discussion boards - Visual Basic / VB.NET[^]
Regarding your actual question, the HttpWebRequest class may what you're looking for.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
I can think of one thing right away that you should check.
i assume that this button you want to click, that isn't doing anything even though you have an action written for it, is not "wired" to the event.
Here, select the button in the gui designer and go to its properties. then click the little lightning bolt in the propertygrid and goto its events... Now... if you see an empty box to the right of the "Click" event... then my guess is right and the event is not wired. Click inside that empty box, and a combobox-dropdown button should appear...hit it and, select "button1_Click" from the list. now it should work
sometimes this happens when you paste stuff from other forms or something...
|
|
|
|
|
No, the event of Click was already on button1_Click it didn't work.
SnaidiS(Semion)
|
|
|
|
|
hmm...then it's probably a logic bug in your code or that control or somewhere between.
did you try setting a breakpoint and stepping into it?
I'm not sure if you know this or not. you click in the margin to the left of this line "private void button1_Click(" and get a little red circle to appear...the breakpoint... then do debug -> start. and when you click the button, the code should run to that line.. then do debug -> "step into" and line after line see what gets executed and what doesn't.
if you cant figure it out...you can send me you test project and i can try to find the problem. i know you posted the code, but i'm a bit lazy to recreate your project...and maybe theirs something not in the code thats messing it up :P
|
|
|
|
|
I tried to debug it and when I click the button it makes the function but I dont see the results on screan..
OK, I'll upload the project.
Here is the project.
http://fileho.com/download/e95cc0167872/Graphics.rar.html[^]
and listen If you have problem with the Graph Control so the dll is on the folder.
Thanks
SnaidiS(Semion)
|
|
|
|
|
my email is the username i use here @gmail... :P
|
|
|
|
|
|
ok i figured it out :P
zgc.Invalidate();
add that to the end of your createGraph function.
it tells that control that it needs to be invalidated cause its data was changed. its really the control makers fault here... they should of done that automatically when the data is changed :P
if you ever get problems...
zgc.Refresh(); this can do it and force the repaint to happen right away, but i think it might be slower... its better with invalidate :P
their are other things like
zgc.SuspendLayout()
make lots of changes to the control
zgc.ResumeLayout()
if you encounter lots of flickering or whatnot ... these functions exist in all controls that inherit system.control or system.usercontrol fyi ...like if you ever get this problem in the future :P
i was tipped off to the problem when while stepping through with the debugger that i saw the button working properly... and it was because the whole form was getting invalidated cause of the debugger kept on moving ontop of the window with each refresh..or something...
|
|
|
|
|
Thanks! It works now, you are great!
May the world be full with people like you
Thanks !
SnaidiS(Semion)
|
|
|
|
|
Glad it worked
|
|
|
|
|
Hello. I am trying to get a program to insert the date at where current text is being typed (not explained very well, I mean the little line when you type name is on the tip of my tongue...). At first I tried to get it to appear using the following code
<br />
rchTextCode = rchTextCode.txt + DateTime.Today;<br />
But it only added it at the end of the text
I am sure I am doing something really obviously wrong, any help? <
|
|
|
|
|
Try the following:
textBox1.Text = textBox1.Text.Insert(textBox1.SelectionStart, DateTime.Today.ToString());
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|