1. This Board Rocks has been moved to a new domain: CarolinaPanthersForum.com

    All member accounts remain the same.

    Most of the content is here, as well. Except that the Preps Forum has been split off to its own board at: http://www.prepsforum.com

    Welcome to the new Carolina Panthers Forum!

    Dismiss Notice

Client Network Server Database Help

Discussion in 'Technology Forum' started by lj4three, Dec 8, 2003.

  1. lj4three

    lj4three Resident Non-A-Rab

    Age:
    43
    Posts:
    6,111
    Likes Received:
    0
    Joined:
    Jan 7, 2003
    Location:
    Charlotte, NC, USA
    fuck this query shit.
     
  2. chipshot

    chipshot Full Access Member

    Age:
    50
    Posts:
    33,519
    Likes Received:
    0
    Joined:
    Feb 6, 2002
    Location:
    Boise
    Queries are the single easiest thing you can do once you get used to it.
     
  3. lj4three

    lj4three Resident Non-A-Rab

    Age:
    43
    Posts:
    6,111
    Likes Received:
    0
    Joined:
    Jan 7, 2003
    Location:
    Charlotte, NC, USA
    it was a joke.

    queer=query. i'll be back tomorrow, y'all be good now.


    seriously- this socket stuff is bs. i can pass the values as strings back and forth, but there has to be a way where i can pass a dataview or dataset or something.. sheesh.
     
  4. chipshot

    chipshot Full Access Member

    Age:
    50
    Posts:
    33,519
    Likes Received:
    0
    Joined:
    Feb 6, 2002
    Location:
    Boise
    um ok.... that was pretty bad :D
     
  5. Meow

    Meow Who me?

    Posts:
    1,231
    Likes Received:
    0
    Joined:
    Jan 8, 2003
    Post your assignment.:D I love this stuff.
     
  6. chipshot

    chipshot Full Access Member

    Age:
    50
    Posts:
    33,519
    Likes Received:
    0
    Joined:
    Feb 6, 2002
    Location:
    Boise
    Hmm, what is the possibillity of serializing the dataset and transmitting it as a string and deserializing in the application? Really the sockets thing is stupid, if you didnt have to use them you could use xml.
     
  7. lj4three

    lj4three Resident Non-A-Rab

    Age:
    43
    Posts:
    6,111
    Likes Received:
    0
    Joined:
    Jan 7, 2003
    Location:
    Charlotte, NC, USA
    its fucking bullshit.

    i have to present this shit tomorrow, deployed and all for all these fuckers to use.

    here's my code, this is what is giving me trouble now, its not filling my dataset (studentInfoSet for some reason)- i dont know what the hell is up wit dis.



    Public Function VerifyStudent() As Boolean
    Try
    'this establishes the connection to the specified path
    connection.ConnectionString = connectionString
    'this opens the connection to the database
    connection.Open()
    commandString.CommandType = CommandType.Text
    MsgBox("DB works", MsgBoxStyle.Information + MsgBoxStyle.OKOnly)
    Catch ex As Exception
    MsgBox("Database error", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly)
    End Try

    Try
    'query the db for specific studentid.
    sqlString = "Select * FROM Students WHERE StudentID = " & studentID
    'create a new adapter for the specified sql string
    studentAdapter = New OleDb.OleDbDataAdapter(sqlString, connectionString)
    'instanitate new dataset
    studentDataSet = New DataSet
    'Fill the dataset
    studentAdapter.Fill(studentDataSet, "Students")
    'see how many items are returned in the dataset
    Dim count As Integer = 0
    count = studentDataSet.Tables("Students").Rows.Count()
    'if the count is not equal to one, then this is not a verifiable student
    If count = 1 And _
    studentDataSet.Tables("Students").Rows.Item(0).Item("StudentLoginPassword") = password Then
    'now refill dataset with studentcourses info
    Dim tempString As String = "Select * FROM StudentCourses WHERE StudentID = " & studentID
    'reinstantiate a new oledbadapter
    studentInfoAdapter = New OleDb.OleDbDataAdapter(tempString, connectionString)
    'instantiate new dataset
    studentInfoSet = New DataSet
    'Fill the dataset
    studentAdapter.Fill(studentInfoSet, "StudentCourses")
    Return True

    Else : Return False
    End If
    Catch ex As Exception
    MsgBox("Error: " & ex.ToString, MsgBoxStyle.OKOnly)
    End Try
    connection.Close()
    End Function
     
  8. lj4three

    lj4three Resident Non-A-Rab

    Age:
    43
    Posts:
    6,111
    Likes Received:
    0
    Joined:
    Jan 7, 2003
    Location:
    Charlotte, NC, USA
    i have the read/write shit down. you can only pass string vals, so what i did was simply catch the row, parse it and send the necessary data using the writer to an arraylist client side.

    anyone got 2 cans and some shoe lace?

    here's the db i'm pulling from, it doesnt fill for some unearthly reason.
     
  9. chipshot

    chipshot Full Access Member

    Age:
    50
    Posts:
    33,519
    Likes Received:
    0
    Joined:
    Feb 6, 2002
    Location:
    Boise
    Did you notice that you are referring to the adapter differently within your block of bold code?
     
  10. lj4three

    lj4three Resident Non-A-Rab

    Age:
    43
    Posts:
    6,111
    Likes Received:
    0
    Joined:
    Jan 7, 2003
    Location:
    Charlotte, NC, USA
    :( :( :( :( :( :( :(

    3 hours of my life i'll never get back. i owe you one chipshot. i had to get something to eat, but i'm back at it. i'll let y'all know how it goes.
     

Share This Page