-
No Value given for one or more parameters
Hi , I'm having a problem with my dataset for some reason . I've check my sql query and it looks 100% correct. the part where I get this error comes down to the adaptor.fill line . Here is the actual code : (sql is the query and con is the connection , the part in bold is where the error occurs)
adapt.SelectCommand = New OleDbCommand(sql, con)
Line 383: adapt.Fill(dSet, dSet.DataSetName)
-
You may want to post your SQL statement so that we can take a look.
Paul
~~~~
Microsoft MVP (Visual Basic)
-
 Originally Posted by pclement
You may want to post your SQL statement so that we can take a look.
Heres the query string : query = "SELECT DISTINCT CaseNumber,PartyNameFull,Ty,Filing,CAT,CSID FROM Civilpartynames3 WHERE CaseNumber = " & CaseNumberTextBox.Text
Heres my function that creates the connection and executes the query string
Public Function getData(ByVal query As String) As DataSet
Dim PathInfo As String
PathInfo = "Provider=Microsoft.Jet.OLEDB.4.0;"
PathInfo += "Data Source=C:\Inetpub\wwwroot\CivilComplaintCases\bin\CivilCourt.mdb"
Dim con As OleDbConnection = New OleDbConnection(PathInfo)
Dim adapt As New OleDbDataAdapter
Dim sql As String = query
Dim data As New DataSet
con.Open()
adapt.SelectCommand = New OleDbCommand(sql, con)
adapt.Fill(data,data.datasetname)
con.Close()
Return data
End Function
-
Nevermind, I think I found my problem which was I didnt have the single quotes around the casenumbertextbox.text but I'm still having the same problem when I execute this string :
query = "SELECT DISTINCT CaseNumber,PartyNameFull,Ty,Filing,CAT,CSID FROM Civilpartynames3 WHERE CivilPartyNames3.CaseNumber = CivilattyNames.CaseNumber AND Civilattynames.AttyNM = " & "'" & attorneyNameDropDown.SelectedItem.ToString & "'"
Last edited by Matrix.net; 10-10-2006 at 02:08 PM.
-
I think the problem has to do with using two tables, I must be querying it incorrectly somehow.
Last edited by Matrix.net; 10-10-2006 at 02:46 PM.
-
It looks like you're missing CivilattyNames in the FROM clause.
"FROM Civilpartynames3, CivilattyNames WHERE..."
Paul
~~~~
Microsoft MVP (Visual Basic)
-
CivilattyNames table is not refered. Execute the same query before putting in .NET file
Similar Threads
-
By wandera in forum VB Classic
Replies: 4
Last Post: 11-25-2005, 03:11 AM
-
By Frank Oquendo in forum .NET
Replies: 4
Last Post: 07-15-2002, 10:25 AM
-
By Carl in forum VB Classic
Replies: 2
Last Post: 05-09-2001, 01:46 PM
-
By Simon Sellick in forum VB Classic
Replies: 0
Last Post: 06-23-2000, 09:30 AM
-
By Matt Uhrich in forum VB Classic
Replies: 5
Last Post: 04-27-2000, 08:52 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks