Connecting Tech Pros Worldwide Help | Site Map

Nicodemas Nicodemas is offline

Expert

Visitor Messages

Showing Visitor Messages 1 to 1 of 1
  1. freefony
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim surname As DataColumn
    Dim otherNames As DataColumn
    Dim connection As SqlConnection = New SqlConnection("server=olaolu\SQLEXPRESS;database=D epartment Database;integrated security=true")
    Try
    Dim command As SqlCommand = New SqlCommand("INSERT INTO Student info ([SurName], [OtherNames]) VALUES (@SurName, @OtherNames)", connection)
    command.Parameters.Add(New SqlParameter("@surname", surname.DataType))
    command.Parameters.Add(New SqlParameter("@OtherNames", OtherNames.DataType))
    connection.Open()
    command.ExecuteNonQuery()
    connection.Close()
    Finally
    If connection.State = ConnectionState.Open Then
    connection.Close()
    End If
    End Try

    a null reference exception results pls edit these codes 4 me.thanks

About Me

  • About Nicodemas
    Occupation
    Project Manager

Statistics

Total Posts
Visitor Messages
General Information
  • Last Activity: June 29th, 2009 03:44 PM
  • Join Date: November 28th, 2007

Friends

Showing Friends 1 to 3 of 3

Contact Info

Instant Messaging
Send an Instant Message to Nicodemas Using...
Home Page
http://www.nicodemas.com
This Page
http://bytes.com/profile/158495/nicodemas/