Click here to Skip to main content
15,923,087 members
Home / Discussions / Database
   

Database

 
QuestionPostgreSQL bootstrap installer VS2005 Pin
dybs23-Aug-08 10:17
dybs23-Aug-08 10:17 
QuestionException with Access Database on Windows Vista Pin
Eng Mohammed Osman23-Aug-08 6:22
Eng Mohammed Osman23-Aug-08 6:22 
AnswerRe: Exception with Access Database on Windows Vista Pin
Jerry Hammond23-Aug-08 7:40
Jerry Hammond23-Aug-08 7:40 
Questionsql count Pin
bapu288923-Aug-08 3:49
bapu288923-Aug-08 3:49 
AnswerRe: sql count Pin
Mycroft Holmes23-Aug-08 23:05
professionalMycroft Holmes23-Aug-08 23:05 
GeneralRe: sql count Pin
bapu288923-Aug-08 23:24
bapu288923-Aug-08 23:24 
GeneralRe: sql count Pin
Blue_Boy24-Aug-08 10:10
Blue_Boy24-Aug-08 10:10 
AnswerRe: sql count Pin
NeverHeardOfMe24-Aug-08 11:42
NeverHeardOfMe24-Aug-08 11:42 
Wel, given that by line 3 all you have done is establish a database connection, what can you epect your If... statement to return?

Try something more along these lines

Dim MyData As New SqlCommand("SELECT * FROM IMS", dcIMS
MyReader = MyData.ExecuteReader
If MyReader.HasRows Then
   Do While MyReader.Read
      ' ...whatever
   Loop
Else
   cboDisp.Text = "Empty Database"
End If
MyReader.Close()
dcIMS.Close()


As an aside, you should not, as a rule, leave Closing your database connection to the Finally clause of a Try block - what happens if an error occurs outside that? Instead, open your Db connections at the last moment possible, and close them immediately after, and test for an open connection in Catch part - eg:

Dim dbConn As New SqlConnection
...
Try
   ..some code
   dbConn.Open
   .. data amnipulation
    dbConn.Close
   ..more code
Catch
   If dbConn.State = ConnectionState.Open Then dbConn.Close()
   ...
End Try
...

AnswerRe: sql count Pin
bapu288924-Aug-08 21:57
bapu288924-Aug-08 21:57 
Questionneed help with SQL Pin
Sujay chakraborty22-Aug-08 21:46
Sujay chakraborty22-Aug-08 21:46 
AnswerRe: need help with SQL Pin
www.Developerof.NET22-Aug-08 22:17
www.Developerof.NET22-Aug-08 22:17 
QuestionRe: need help with SQL Pin
Sujay chakraborty23-Aug-08 21:19
Sujay chakraborty23-Aug-08 21:19 
AnswerRe: need help with SQL Pin
Paul Conrad23-Aug-08 7:29
professionalPaul Conrad23-Aug-08 7:29 
GeneralRe: need help with SQL Pin
Kanniah23-Aug-08 20:22
Kanniah23-Aug-08 20:22 
GeneralRe: need help with SQL Pin
Pete O'Hanlon24-Aug-08 11:11
mvePete O'Hanlon24-Aug-08 11:11 
QuestionSQL query to copy table from one database into another database Pin
ankswe22-Aug-08 19:24
ankswe22-Aug-08 19:24 
AnswerRe: SQL query to copy table from one database into another database Pin
Mycroft Holmes22-Aug-08 19:41
professionalMycroft Holmes22-Aug-08 19:41 
GeneralRe: SQL query to copy table from one database into another database Pin
Jerry Hammond23-Aug-08 7:37
Jerry Hammond23-Aug-08 7:37 
GeneralRe: SQL query to copy table from one database into another database Pin
Mycroft Holmes23-Aug-08 13:48
professionalMycroft Holmes23-Aug-08 13:48 
QuestionConnecting to custom database [modified] Pin
ASPnoob22-Aug-08 17:31
ASPnoob22-Aug-08 17:31 
AnswerRe: Connecting to custom database Pin
Mycroft Holmes22-Aug-08 19:47
professionalMycroft Holmes22-Aug-08 19:47 
QuestionExpansion advice Pin
David Kalkwarf22-Aug-08 16:16
David Kalkwarf22-Aug-08 16:16 
AnswerRe: Expansion advice Pin
FyreWyrm22-Aug-08 18:01
FyreWyrm22-Aug-08 18:01 
GeneralRe: Expansion advice Pin
David Kalkwarf23-Aug-08 5:35
David Kalkwarf23-Aug-08 5:35 
AnswerRe: Expansion advice Pin
Mycroft Holmes22-Aug-08 19:58
professionalMycroft Holmes22-Aug-08 19:58 

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.