|
-
Feb 2nd, 2004, 02:44 PM
#1
Thread Starter
Hyperactive Member
SQLException error on Fill Method [RESOLVED]
Hey Guys,
I apologize for the vague question, but I'm getting a real generic 'SQLException' error on the Fill method of my SQLDataAdapter object. I had this working maybe a month ago, but I haven't worked with it since then.
Any ideas what causes such a generic error? I get five of them before the program shuts down.
Thanks!
--Ben
Last edited by BenFinkel; Feb 3rd, 2004 at 12:03 PM.
-
Feb 2nd, 2004, 03:59 PM
#2
Frenzied Member
I'd guess something's wrong with your SQL or code that uses it. Post some code use a try/catch block to get the exception message or tostring. msgbox your SQL before it executes, etc.
-
Feb 3rd, 2004, 10:09 AM
#3
Thread Starter
Hyperactive Member
I can tell you my SQL code without even looking at it:
"vwQuoteReport"
It's just a view in the SQL Database.
--Ben
-
Feb 3rd, 2004, 10:43 AM
#4
Frenzied Member
Ok, but how do you call it? still need some code. And probably someone smarter than me.
-
Feb 3rd, 2004, 11:59 AM
#5
Thread Starter
Hyperactive Member
My Code:
Code:
Dim dsTemp As New M3DataSource()
Dim rsRpts As ADODB.Recordset
Dim strTableName As String
Dim dsQuote As DataSet
Dim sdcQuote As SqlClient.SqlConnection
Dim sdaQuote As SqlClient.SqlDataAdapter
Dim strSQL As String
'First, get the report info from the table
strSQL = "SELECT tblReports.* FROM tblReports " & _
" WHERE [chrRptName] = '" & strName & "'"
dsTemp.Connect()
dsTemp.GetRecordSet(rsRpts, strSQL)
If rsRpts.EOF Or rsRpts.BOF Then
Exit Function
End If
strSQL = rsRpts.Fields("chrRptSQL").Value & " " & strWhere
strTableName = rsRpts.Fields("chrRptTableName").Value
dsTemp.Close()
sdcQuote = New SqlClient.SqlConnection(gstrSDCString)
sdaQuote = New SqlClient.SqlDataAdapter(strSQL, sdcQuote)
dsQuote = New DataSet()
sdaQuote.Fill(dsQuote, strTableName)
Errors occur on the last line. strTableName = "vwrptQuote" which is definatley a view in my database.
Thanks!
--Ben
-
Feb 3rd, 2004, 12:02 PM
#6
Thread Starter
Hyperactive Member
Nevermind, I'm an Ass!
I changed my Server name and never updated the connection string. I'm such an idiot...
Thanks for the help!
--Ben
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|