Results 1 to 4 of 4

Thread: Some easy questions

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    3

    Some easy questions

    hi,

    my codes is

    Dim connection as New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))

    Dim command as New SqlCommand("Select * from teacher where SNo = @SNo',connection)

    command.Parameters.Add("@SNo",lol.text)
    Dim dataAdapter as New SqlDataAdapter(command)
    Dim result as New dataSet

    connection.open()
    dataAdapter.Fill(result,"teacher")
    connection.close()


    my error is
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where ir originated from the code.

    Exception Detail : System.InvalidOperationException. The connectionString property has not been initialized..

    Source error
    Line 60 connection.Open()

  2. #2

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    3

    Re: Some easy questions

    sorry I solved that error already

    however I faced another problem

    Exception Detail: System Index Out of Range Exception. There is no row at position 0
    lb1.Text = result.Tables("Teacher").Rows(0).Item("SAddress")

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    3

    Re: Some easy questions

    ok all my problem solved, thanks guy for taking a look

  4. #4
    Fanatic Member
    Join Date
    Aug 2006
    Location
    Chicago, IL
    Posts
    514

    Re: Some easy questions

    Please mark your post resolved by using the Thread Tools near the top of the post. Thank you.
    Warren Ayen
    Senior C# Developer
    DLS Software Studios (http://www.dlssoftwarestudios.com/)

    I use Microsoft Visual Studio 2005, 2008, working with Visual Basic and Visual C#
    Hey! If you like my post, or I solve your issue, please Rate Me!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width