can any one help me about this error

Private Sub BtnSave_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click
        If Objconnection.State = ConnectionState.Closed Then
            Try

            Catch ex As Exception

            End Try
            Objconnection.Open()---->>> The ConnectionString property has not been initialized.


            

        End If

        Objcmmand = New SqlCommand(" Insert into cases_of_accidents ( IdVehicle , VehicleName ) values (" & VehicleType_Id.Text & "," & VehicleType_name.Text & ")", Objconnection)
        iresult = Objcommand.ExecuteNonQuuery()
        If iresult > 0 Then
            MessageBox(" Record inserted successfully "

Its really simple, the exception tells you everything.

Before you can open a connection you need to assign the route of the connection string to the database.

i.e.

Objconnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;"
Objconnection.Open()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.