Click here to Skip to main content
15,889,281 members
Home / Discussions / Database
   

Database

 
QuestionPreventing double column value Pin
gharry30-Dec-05 3:40
gharry30-Dec-05 3:40 
AnswerRe: Preventing double column value Pin
Colin Angus Mackay30-Dec-05 9:04
Colin Angus Mackay30-Dec-05 9:04 
QuestionSpecifying DSN in connection string Pin
Maqsood Ahmed29-Dec-05 21:03
Maqsood Ahmed29-Dec-05 21:03 
AnswerRe: Specifying DSN in connection string Pin
abhinish30-Dec-05 0:02
abhinish30-Dec-05 0:02 
QuestionReporting Services Programming Pin
mipooo29-Dec-05 18:10
mipooo29-Dec-05 18:10 
Questionbetter views or procedure? Pin
sasire1829-Dec-05 18:09
sasire1829-Dec-05 18:09 
AnswerRe: better views or procedure? Pin
Colin Angus Mackay30-Dec-05 0:46
Colin Angus Mackay30-Dec-05 0:46 
QuestionSpecified cast is not valid Pin
gharry29-Dec-05 9:38
gharry29-Dec-05 9:38 
Can someone help me with this one i have writen a function that retrieves a Id from a table but the result is not found and i get the above error.

Public Function getID(ByVal strTable As String, ByVal strValue As String) As String
Try
Dim IDConn As SqlConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=EventMngt")
Dim IDString As String = "SELECT Id FROM Boekelo_Horses WHERE Horse_Passport = '" & strValue & "'"
If strTable = "Boekelo_Riders" Then
IDString = "SELECT * FROM Boekelo_Riders WHERE Rider_FEIId = '" & strValue & "'"
End If
Dim IdCommand As New SqlCommand(IDString, IDConn)
IDConn.Open()
Dim IDReader As SqlDataReader = IdCommand.ExecuteReader()
IDReader.Read()
getID = IDReader.GetString(0)
IDConn.Close()
Catch ex As Exception
MessageLabel.Text = strValue & " is not on the DataFile, try again.<br>Error text:" & ex.Message
getID = "-error-"
End Try
End Function

If i comment out the getID = IDRea... line then the function returns no error, if in the function it produces a error. But why??
AnswerRe: Specified cast is not valid Pin
Colin Angus Mackay29-Dec-05 15:30
Colin Angus Mackay29-Dec-05 15:30 
GeneralRe: Specified cast is not valid Pin
gharry29-Dec-05 23:02
gharry29-Dec-05 23:02 
GeneralRe: Specified cast is not valid Pin
gharry29-Dec-05 23:44
gharry29-Dec-05 23:44 
QuestionChanging the location for a replication subscription Pin
SeXyProwler29-Dec-05 9:37
SeXyProwler29-Dec-05 9:37 
QuestionSQL Server security Pin
Fad B29-Dec-05 6:50
Fad B29-Dec-05 6:50 
AnswerRe: SQL Server security Pin
Colin Angus Mackay29-Dec-05 15:38
Colin Angus Mackay29-Dec-05 15:38 
GeneralRe: SQL Server security Pin
Paul Conrad29-Dec-05 18:25
professionalPaul Conrad29-Dec-05 18:25 
GeneralRe: SQL Server security Pin
Fad B29-Dec-05 21:14
Fad B29-Dec-05 21:14 
GeneralRe: SQL Server security Pin
Fad B29-Dec-05 21:15
Fad B29-Dec-05 21:15 
QuestionParsing Text file w/ multple datasets and schema.ini? Pin
Joshua Lunsford29-Dec-05 6:33
Joshua Lunsford29-Dec-05 6:33 
QuestionExport xls from sql Pin
GoodQuestion28-Dec-05 6:52
GoodQuestion28-Dec-05 6:52 
AnswerRe: Export xls from sql Pin
S Douglas5-Jan-06 0:31
professionalS Douglas5-Jan-06 0:31 
GeneralRe: Export xls from sql Pin
GoodQuestion11-Jan-06 12:02
GoodQuestion11-Jan-06 12:02 
QuestionSQL table organization for authentication Pin
shapper28-Dec-05 3:48
shapper28-Dec-05 3:48 
AnswerRe: SQL table organization for authentication Pin
Paul Conrad28-Dec-05 6:38
professionalPaul Conrad28-Dec-05 6:38 
GeneralRe: SQL table organization for authentication Pin
Paul Conrad28-Dec-05 6:51
professionalPaul Conrad28-Dec-05 6:51 
Questionhow to declare the procedures Pin
sasire1828-Dec-05 0:53
sasire1828-Dec-05 0: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.