Click here to Skip to main content
15,903,362 members
Home / Discussions / Database
   

Database

 
GeneralHavving problem with a FILL command Pin
rudemusik24-Oct-04 18:01
rudemusik24-Oct-04 18:01 
Generalupdating doesn't work Pin
ezak24-Oct-04 8:51
ezak24-Oct-04 8:51 
GeneralRe: updating doesn't work Pin
Colin Angus Mackay24-Oct-04 13:10
Colin Angus Mackay24-Oct-04 13:10 
GeneraldateTime column in datagrid Pin
Miri Ofir24-Oct-04 5:53
Miri Ofir24-Oct-04 5:53 
GeneralRe: dateTime column in datagrid Pin
afronaut24-Oct-04 6:38
afronaut24-Oct-04 6:38 
GeneralRe: dateTime column in datagrid Pin
Miri Ofir25-Oct-04 1:55
Miri Ofir25-Oct-04 1:55 
GeneralGetting metadata from SQL Server Pin
Anonymous23-Oct-04 22:53
Anonymous23-Oct-04 22:53 
GeneralRe: Getting metadata from SQL Server Pin
Duncan Edwards Jones24-Oct-04 1:11
professionalDuncan Edwards Jones24-Oct-04 1:11 
GeneralRe: Getting metadata from SQL Server Pin
afronaut24-Oct-04 6:26
afronaut24-Oct-04 6:26 
GeneralRe: Getting metadata from SQL Server Pin
Duncan Edwards Jones24-Oct-04 7:39
professionalDuncan Edwards Jones24-Oct-04 7:39 
GeneralSQL Packages Pin
maro1823-Oct-04 22:01
maro1823-Oct-04 22:01 
GeneralRe: SQL Packages Pin
DreadPirateRoberts27-Oct-04 6:12
DreadPirateRoberts27-Oct-04 6:12 
QuestionSQl statement doesn't work why? Pin
jlawren723-Oct-04 14:12
jlawren723-Oct-04 14:12 
AnswerRe: SQl statement doesn't work why? Pin
afronaut24-Oct-04 6:29
afronaut24-Oct-04 6:29 
QuestionInsert into Syntax error? Pin
mikhaelb23-Oct-04 12:54
mikhaelb23-Oct-04 12:54 
AnswerRe: Insert into Syntax error? Pin
Colin Angus Mackay23-Oct-04 14:02
Colin Angus Mackay23-Oct-04 14:02 
GeneralRe: Insert into Syntax error? Pin
jlawren723-Oct-04 14:08
jlawren723-Oct-04 14:08 
GeneralRe: Insert into Syntax error? Pin
Colin Angus Mackay23-Oct-04 14:29
Colin Angus Mackay23-Oct-04 14:29 
Generalsql to export access table to html file Pin
jlawren723-Oct-04 10:41
jlawren723-Oct-04 10:41 
GeneralRe: sql to export access table to html file Pin
afronaut24-Oct-04 6:46
afronaut24-Oct-04 6:46 
GeneralMS OLAP Visual C++ (.NET) samples Pin
Ilgar22-Oct-04 23:43
Ilgar22-Oct-04 23:43 
GeneralProblem with SQL Server RaiseError with C# Pin
Graham W22-Oct-04 0:58
Graham W22-Oct-04 0:58 
I have a C# application for generic database access that does all sorts of extra processing. It is a port of an existing COM application written in C++.

The application uses objects from Microsoft.Data.Odbc namespace.

So I'm opening an OdbcConnection
and using an OdbcDataApaptor for retrievals, and an OdbcCommand for executing updates using ExecuteNonQuery.

All is working fine except for one thing involving the SQL Server RaiseError command being executed in a trigger.

The code I'm using in the application for update commands is this:

public long ExecuteChangeQuery(string sSQL)
{
long lResult;

try
{
m_cmd.CommandText = sSQL;
lResult = m_cmd.ExecuteNonQuery();
}
catch(OdbcException e)
{
// log the exception
throw e;
}
return lResult;
}

Under normal circumstances everything is fine. And if a normal error occurs, such as a SQL syntax error, etc. the exception is caught as expected.

However when the SQL server trigger calls RaiseError with a severity level of 16, which should throw an exception. Nothing happens. No exception is thrown and the call to ExecuteNonQuery simply returns -1 to indicate that a rollback occurred.

The existing COM application works properly with the same trigger.

Any ideas as to what's going wrong, or what I'm not doing?

Help greatly appreciated.



GeneralSQL statement against MS access Pin
21-Oct-04 14:20
suss21-Oct-04 14:20 
GeneralRe: SQL statement against MS access Pin
afronaut21-Oct-04 14:43
afronaut21-Oct-04 14:43 
GeneralRe: SQL statement against MS access Pin
jlawren721-Oct-04 15:53
jlawren721-Oct-04 15:53 

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.