|
strinsert = "INSERT INTO Transmittal(ReferencedTo, Title, NumberofCopies, Username, ProjectName, KindAttn, RevisionNumber, Action, DrawingDocumentNumber)" + " VALUES ('" + TextBox3.Text + "', '" + TextBox5.Text + "', '" + TextBox9.Text + "', '" + TextBox1.Text + "', '" + TextBox2.Text + "', '" + TextBox4.Text + "', '" + TextBox10.Text + "', '" + TextBox11.Text + "', '" + TextBox7.Text + "' )"
All you had to do is add a space before your "VALUES" keyword.
This is one reason why you DO NOT USE string concatenation to build your SQL statements. How you're building your statement can be broken so easily, it's silly. All the user has to do is put a ' character in any one of those text boxes and your code breaks. Learn how to do it the correct way now, before this bad habit becomes your normal method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanx dave,
the problem is solved by ur code. but the this method is working fine on one application. but on another it again gives the same syntax error. what to do? also what do you mean by parametrised query. or what is the better method can you tell me.
|
|
|
|
|
The syntax error is coming up because you miss-paired double quote marks somewhere.
You can get a taste of parameterized queries here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
but dave if that is the case then it should give error in both the cases. in one form the syntax is working fine and in another form it's giving error. i have also double checked everything.
|
|
|
|
|
All I can say is you're doing something wrong. If you're using the EXACT same statement in both forms, you've missed a character somewhere. Think about it! If the statement works on one form, it must work. So what's different about it on the second form?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ii checked everything dave twice and thrice. but the webform on which the code doesn't work and gives the error. also doesn't work with a code as simple as this.
strsqlinsert = "INSERT INTO Chec (first)" + " VALUES (" + TextBox1.Text + ")"
if there is something wrong with it i don't know about it.
|
|
|
|
|
If your getting a "syntax error", you might want to consider what the field "first" is defined as and what is in the textbox.Text. If your trying to put a string into a number field, obviously, it's not going to work.
Seriously, pick up a book on SQL and VB.NET and save yourself the aggravation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A quick overview of my project aim might help you understand what I am trying to achieve. I am trying to create an area on a form where users can draw a turing machine! For those who dont know what one is , it does not matter too much (although i believe every computer scientist should at least have a basic background of one as it is the foundations of computing! it basically defines what can and cannot be computed).
Basically, i need an area where users can draw circles(which represent the states of the machines) and lines connecting these circles (which represent the transitions). I would like an place where users can click on a icon in the toolbar and then be able to click on the space to create the relevant shape.
I would appreciate any comments on where i can start looking. I've been looking around, and gdi's seem to turn up, but i'm not sure if this is the best way to approach this. Another semi-solution i have thought of is just to create images of these shapes and create a new instance?? of them as required! I am totally lost...
Thanks for your time and effort!
million thanks,
zoe xx:
confused:
|
|
|
|
|
If you're using predefined shapes, then you should certainly use an OO structure to define them. If you're using tools to draw freely, the same applies.
Basically, the way I'd do this is to have a base tool class, and have your application always use an instance of it ( the currently selected tool ). Make a collection of drawing events, generated by these tools, and iterate through it to draw your image. This makes undo/redo really easy to impliment as well.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have seen an article in this site posted by "rainman_63". He has explained UPC-A barcode generation in C# very well. I am a beginner in VB and I need somebody who can convert that c# code into VB6. Your help is greately appreciated.
Regards
Rupesh
|
|
|
|
|
what don't you understand ?
C# is very easy to translate into VB.NET and vice versa as they are both .NET languages (more difficult with C++ in MFC for example)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Here is a toolstrip.
I add a ToolStripDropDownButton on it.
How to add ToolStripDropDownItem by code?
Thanks!
z.y.x.
|
|
|
|
|
Hi, How do I search for personal folders in outlook? With NameSpace.GetDefaultFolder, I can only search folders in Mailbox (such inbox, outbox etc) but not in personal folders. Does anybody know how to do this. Thank you
|
|
|
|
|
Is there a tool/app/program that takes C# soln as input and creates it equivalent VB.NET soln?
|
|
|
|
|
Yes, there are several. But why ruin perfectly good C# code ? :P
Typing 'C# VB.NET convert' into google gives you a ton of matches. Why do people not use google before asking these things ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Our product "Instant VB" converts entire projects (and snippets). Try our Demo Edition (downloadable at www.instantvb.com).
However, we do not offer the ability to enter an entire solution. The sole reason for this is that when converting a solution it is critical to start at the project referenced by the others and work back. Otherwise the manual adjustments necessary in the referenced project are masked by the compile errors in the other project and it hampers the ability to get the entire solution compilable.
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
So long as people are plugging their products, I used C Sharpener to convert VB.NET to C#, and they have one that goes the other way. C Sharpener was brilliant, it worked really well. The URL is www.elegancetech.com[^]
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need serial number for this program.
thanks 4 help
|
|
|
|
|
Great! They take Visa, Master Card, American Express, personal checks, maybe PayPal, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for advice, i thought free for pay i can do it but i mean free serial number.
thanks again
|
|
|
|
|
You must be joking. You write software, but you want to steal from other people who do the same ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi All,
I have a dsm file which was written for VC++ 6 IDE. I want to use this wih VC++ .NET IDE. can some one tell me what changes i should make so that it can run with VC++ .NET IDe also
Thanks in advance,
Regards
Raghu
|
|
|
|
|
Your best bet is to look at Microsoft's converted VC6 sample macros that have been converted to VB .NET. (They're in the file DevStudio6Editor in MacroExplorer.) Then study the differences and work from there.
There is also a specific VS add-ins and macros Yahoo group you could try posting to here:
http://groups.yahoo.com/group/vsnetaddin/?yguid=75841244[^]
Kevin
|
|
|
|
|
Dear Friends
I have a send email program in VB.NET my programm is running well it sents the mail file in c:\Inetpub\mailroot\Queue but from there it is not sending to the recepient. the mail files are still in Queue folder even i am connected to the internet and even my smtp service is running well.
please help me. your quick response will be highly appreciated.
Thanks
Patel Murtuza
|
|
|
|
|
hi..I could run word with VB6 now I want to save the doc file on server ..how can do that?
|
|
|
|