DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259

    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)

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    You may want to post your SQL statement so that we can take a look.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    Quote 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

  4. #4
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    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.

  5. #5
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    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.

  6. #6
    Join Date
    Dec 2003
    Posts
    2,750
    It looks like you're missing CivilattyNames in the FROM clause.

    "FROM Civilpartynames3, CivilattyNames WHERE..."
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  7. #7
    Join Date
    Oct 2006
    Posts
    1
    CivilattyNames table is not refered. Execute the same query before putting in .NET file

Similar Threads

  1. Passing Multiple Parameters to a DLL function
    By wandera in forum VB Classic
    Replies: 4
    Last Post: 11-25-2005, 03:11 AM
  2. Optional Parameters in C#
    By Frank Oquendo in forum .NET
    Replies: 4
    Last Post: 07-15-2002, 10:25 AM
  3. Replies: 2
    Last Post: 05-09-2001, 01:46 PM
  4. parameters for connection command
    By Simon Sellick in forum VB Classic
    Replies: 0
    Last Post: 06-23-2000, 09:30 AM
  5. Stored Procedures With Parameters
    By Matt Uhrich in forum VB Classic
    Replies: 5
    Last Post: 04-27-2000, 08:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links