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

Database

 
GeneralMS Access Database Connection with VB.NET Pin
EdZa8-Nov-03 12:21
EdZa8-Nov-03 12:21 
GeneralRe: MS Access Database Connection with VB.NET Pin
Pauwll8-Nov-03 16:27
Pauwll8-Nov-03 16:27 
GeneralRe: MS Access Database Connection with VB.NET Pin
Mike Dimmick11-Nov-03 10:24
Mike Dimmick11-Nov-03 10:24 
GeneralRe: MS Access Database Connection with VB.NET Pin
Member 59242011-Nov-03 19:20
Member 59242011-Nov-03 19:20 
GeneralConverting from SQL server to MS Access Pin
pankajdaga8-Nov-03 12:05
pankajdaga8-Nov-03 12:05 
QuestionExecuteScalar with COUNT causes Exception? Pin
Pauwll8-Nov-03 1:21
Pauwll8-Nov-03 1:21 
AnswerRe: ExecuteScalar with COUNT causes Exception? Pin
jeff_martin11-Nov-03 11:54
jeff_martin11-Nov-03 11:54 
GeneralRe: ExecuteScalar with COUNT causes Exception? Pin
Pauwll12-Nov-03 6:00
Pauwll12-Nov-03 6:00 
jeff_martin wrote:
Can you post some code?

Jeff, here it is.
I'm connecting to an MDB. Other connections (SELECT and UPDATE) all work fine.
The funny thing is, when I run it in MS-Access, it comes up with no COUNT row.
If I run it for some other SITENAME, it works fine...

If I do it without the TRY/CATCH, it will bomb out when there should be ZERO as a result.
NOTE: There are NO records in the table that match SITENAME='OFFICE'


================code start====================
Int32 founditems=0;
OleDbConnection conn = new OleDbConnection(s_db_connectionstring);

string counter = "SELECT Count(*) FROM Servers WHERE ((Sitename)='OFFICE')) GROUP BY Servername,SiteName ORDER BY Servername,Sitename;";

OleDbCommand cmd = new OleDbCommand(counter,conn);

try
{
founditems = (Int32) cmd.ExecuteScalar();
}
catch(System.Exception e1)
{
founditems=0;
}

================code end====================




Pauwl
GeneralRe: ExecuteScalar with COUNT causes Exception? Pin
jeff_martin12-Nov-03 7:25
jeff_martin12-Nov-03 7:25 
GeneralRe: ExecuteScalar with COUNT causes Exception? Pin
Pauwll12-Nov-03 16:27
Pauwll12-Nov-03 16:27 
GeneralRe: ExecuteScalar with COUNT causes Exception? Pin
jeff_martin13-Nov-03 3:41
jeff_martin13-Nov-03 3:41 
GeneralRe: ExecuteScalar with COUNT causes Exception? Pin
Pauwll13-Nov-03 5:07
Pauwll13-Nov-03 5:07 
GeneralPutting fixed array into DB field Pin
EddieSD647-Nov-03 11:31
sussEddieSD647-Nov-03 11:31 
GeneralStored Procs, parameters and IN Clause Pin
stephen woolhead7-Nov-03 5:00
stephen woolhead7-Nov-03 5:00 
GeneralRe: Stored Procs, parameters and IN Clause Pin
jeff_martin11-Nov-03 12:04
jeff_martin11-Nov-03 12:04 
GeneralSQL Server does not exist or access denied Pin
yyf7-Nov-03 2:50
yyf7-Nov-03 2:50 
GeneralProblem with _Connection::Open ! Pin
nigs_krec7-Nov-03 1:53
nigs_krec7-Nov-03 1:53 
GeneralManaged .NET Embedded Database Pin
Andrew Shapira6-Nov-03 10:11
Andrew Shapira6-Nov-03 10:11 
GeneralRe: Managed .NET Embedded Database Pin
Mike Dimmick7-Nov-03 2:54
Mike Dimmick7-Nov-03 2:54 
GeneralRe: Managed .NET Embedded Database Pin
Andrew Shapira7-Nov-03 10:17
Andrew Shapira7-Nov-03 10:17 
GeneralRe: Managed .NET Embedded Database Pin
Arjan Einbu10-Nov-03 11:01
Arjan Einbu10-Nov-03 11:01 
GeneralRe: Managed .NET Embedded Database Pin
Andrew Shapira10-Nov-03 13:57
Andrew Shapira10-Nov-03 13:57 
GeneralMax Pool Size's Limitation Pin
yyf6-Nov-03 8:43
yyf6-Nov-03 8:43 
GeneralCreating a DBASE file Pin
DonBush6-Nov-03 4:04
DonBush6-Nov-03 4:04 
GeneralRe: Creating a DBASE file Pin
Jörgen Sigvardsson6-Nov-03 14:00
Jörgen Sigvardsson6-Nov-03 14:00 

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.