Click here to Skip to main content
15,888,610 members
Home / Discussions / Database
   

Database

 
GeneralRe: datatable expression column Pin
Xmen Real 31-Mar-08 1:26
professional Xmen Real 31-Mar-08 1:26 
Questionhow to solve this erro plz Pin
lakshmichawala29-Mar-08 2:38
lakshmichawala29-Mar-08 2:38 
AnswerRe: how to solve this erro plz Pin
Ali Rashid29-Mar-08 4:08
Ali Rashid29-Mar-08 4:08 
GeneralSQL Server Pin
Ali Rashid29-Mar-08 2:11
Ali Rashid29-Mar-08 2:11 
GeneralRe: SQL Server [modified] Pin
Syed Mehroz Alam29-Mar-08 6:19
Syed Mehroz Alam29-Mar-08 6:19 
GeneralRe: SQL Server Pin
Ali Rashid29-Mar-08 23:43
Ali Rashid29-Mar-08 23:43 
GeneralRe: SQL Server Pin
Blue_Boy29-Mar-08 11:19
Blue_Boy29-Mar-08 11:19 
GeneralDbCommand execute and sql script with "GO" Pin
devvvy28-Mar-08 20:54
devvvy28-Mar-08 20:54 
Hi - I'm having trouble running a sql script with "GO" using DbCommand...

sql scripts looks like this:
<br />
declare EmpCur cursor for (<br />
   select * from employee where ...<br />
)<br />
GO << This go leads to error when run by DbCommand (Although NO error when run on ASE isql -- against Sybase)<br />
... more processing ...<br />
GO<br />

Now, the code is like this:

      DataSet oDataSet = new DataSet(strName);<br />
      DbProviderFactory oDbProviderFactory = null;<br />
      DbDataAdapter oAdapter = null;<br />
      DbCommand oCmd = null;<br />
      DbConnection oConn = null;<br />
<br />
        oDbProviderFactory = CDataUtil.GetConnectionFactory(strProvider);<br />
        oConn = oDbProviderFactory.CreateConnection();<br />
        oConn.ConnectionString = strConnectionString;<br />
<br />
        oCmd = oDbProviderFactory.CreateCommand();<br />
        oCmd.CommandText = m_Cmd.RenderCommand(null); <br />
        oCmd.Connection = oConn;<br />
<br />
        oAdapter = oDbProviderFactory.CreateDataAdapter();<br />
        oAdapter.SelectCommand = oCmd;<br />
        <br />
        oConn.Open();<br />
        oAdapter.Fill(oDataSet, strName);


Error message is like this:
2008-03-28 17:53:20,875 [1] ERROR XXXComponent - SQL command failed.<br />
Message: ERROR [42000] [MERANT][ODBC Sybase driver][SQL Server]Incorrect<br />
syntax near 'go'.


devy

GeneralRe: DbCommand execute and sql script with "GO" Pin
Mike Dimmick28-Mar-08 22:49
Mike Dimmick28-Mar-08 22:49 
GeneralRe: DbCommand execute and sql script with "GO" Pin
devvvy28-Mar-08 22:53
devvvy28-Mar-08 22:53 
GeneralRe: DbCommand execute and sql script with "GO" Pin
pmarfleet28-Mar-08 23:31
pmarfleet28-Mar-08 23:31 
GeneralRe: DbCommand execute and sql script with "GO" Pin
devvvy28-Mar-08 23:33
devvvy28-Mar-08 23:33 
GeneralDECLARE CURSOR must be the only statement in a query batch. -- Re: DbCommand execute and sql script with "GO" Pin
devvvy30-Mar-08 16:52
devvvy30-Mar-08 16:52 
QuestionHow to reorder uniqueIdentifier field? Pin
maryam.saboor28-Mar-08 19:19
professionalmaryam.saboor28-Mar-08 19:19 
AnswerRe: How to reorder uniqueIdentifier field? Pin
pmarfleet28-Mar-08 23:33
pmarfleet28-Mar-08 23:33 
GeneralRe: How to reorder uniqueIdentifier field? Pin
maryam.saboor29-Mar-08 0:35
professionalmaryam.saboor29-Mar-08 0:35 
GeneralRe: How to reorder uniqueIdentifier field? Pin
pmarfleet29-Mar-08 1:47
pmarfleet29-Mar-08 1:47 
Questionstored procedure problem Pin
md_azy28-Mar-08 18:40
md_azy28-Mar-08 18:40 
GeneralRe: stored procedure problem Pin
pmarfleet28-Mar-08 23:34
pmarfleet28-Mar-08 23:34 
GeneralRe: stored procedure problem Pin
Mike Dimmick28-Mar-08 23:38
Mike Dimmick28-Mar-08 23:38 
QuestionHow to recover sql server corrupted paged database? Pin
AhmetGULBAY28-Mar-08 7:09
AhmetGULBAY28-Mar-08 7:09 
GeneralDifference between INNER JOIN and WHERE Clause Pin
soso_online28-Mar-08 3:39
soso_online28-Mar-08 3:39 
GeneralRe: Difference between INNER JOIN and WHERE Clause Pin
GuyThiebaut28-Mar-08 4:57
professionalGuyThiebaut28-Mar-08 4:57 
GeneralRe: Difference between INNER JOIN and WHERE Clause Pin
Joe DiNatale28-Mar-08 5:55
Joe DiNatale28-Mar-08 5:55 
GeneralSecurity Model Recommendations for ASP.NET Client Pin
Brady Kelly28-Mar-08 2:59
Brady Kelly28-Mar-08 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.