Re: re:SQL Insert Command - Field with Punctuation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 10/27/04


Date: Wed, 27 Oct 2004 00:20:56 -0400

Add a Semicolon at the end of each line and just change the declaration ie
SqlCommand cmd = new SqlCommand(sqlInsert, connection);

Definitely want to avoid the dynamic sql - nothing but drama if you're not
using parameters.

-- 
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"jbardrof" <jbardrof@gmail-dot-com.no-spam.invalid> wrote in message
news:417ef1e8$1_2@Usenet.com...
> how would i do that in c#?
>
> *-----------------------*
>         Posted at:
>   www.GroupSrv.com
> *-----------------------*


Relevant Pages

  • Re: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSE
    ... The connection cannot be used to perform this operation. ... vPIPK = Server.HTMLEncode) ... I thought you got rid of all your dynamic sql .... ... not the recordset object. ...
    (microsoft.public.data.ado)
  • Re: Adding a SQL Dataset and instant error
    ... SqlCommand cmd; ... As soon as the connection is complete I get a compilation error of ... If I remove the 'project' so that it appears as 'new dataset' then all is OK, but any time i modify anything to do with the DataGridView the designer.cs file is modified and returned to the erorr state. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What happend to this group.
    ... To avoid the flood, ... For Anne the resolution's sure, ahead of me it's corresponding, whereas ... Why did Lloyd restrict with regard to all the importances? ... resign it in connection with its firm. ...
    (sci.crypt)
  • Re: Am i calling the database twice?
    ... SqlCommand cmd = new SqlCommand ... int res = cmd.ExecuteNonQuery; ... to another for all eternity and beyond. ... so it will use one connection only. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Handling Unexpected Exceptions in C# windows application
    ... You should wrap your connection openning in a try/catch. ... your application to terminate, regarding your question, you can use ... Application.ThreadException event to capture any unhandled exception, ... will avoid the error dialog from the framework, ...
    (microsoft.public.dotnet.languages.csharp)