Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:19:08+00:00 2026-06-14T07:19:08+00:00

I am creating a vb.net application in which I’m getting error A first chance

  • 0

I am creating a vb.net application in which I’m getting error ”
A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll" I dont know how to solve this error and there are 4 fields in tables

  1. o_id primary key auto increment by 1
  2. c_id static
  3. owner_name varchar()
  4. investment

    Dim connetionString As String
    
    Dim cnn As SqlConnection
    
    Dim cmd As New SqlCommand
    
    
    connetionString = "Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\javed\Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\bin\Debug\Database1.mdf';Integrated Security=True;User Instance=True"
    
    cnn = New SqlConnection(connetionString)
    
    Try
    
        cnn.Open()
        MsgBox("Connection is Open ! ")
        cmd.Connection = cnn
        cmd.CommandText = "INSERT INTO owner_detail(c_id, o_name, investment) values(@cid,'" + TextBox1.Text + "','" + TextBox2.Text + "')"
        cmd.ExecuteNonQuery()
        MsgBox("Data is Successfully Inserted! ")
        cnn.Close()
    
    Catch ex As Exception
    
        MsgBox("Can not open connection ! ")
    
    End Try
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:19:09+00:00Added an answer on June 14, 2026 at 7:19 am

    You are not adding the parameter @cid anywhere.

    cmd.Parameters.Add(new SqlParameter("@cid", SqlDbType.Int))
    cmd.Parameters("@cid").Value = Idvalue
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating iphone application which will require data from .NET web services. I
I'm creating an ASP.NET application which uses Facebook Connect and fbml tags. It also
Background I am creating an ASP.net application which uses a custom library (not yet
I am creating a asp.net mvc application and loaded the data into jqgrid and
While creating the setup for VB.net application I am getting the following warning: Warning
I'm creating .NET application which connects to WindowsCE device using Active Sync. I'm using
I have an ASP.NET MVC 2 application in which I am creating a custom
I have an ASP.NET application which tracks statistics by creating and writing to custom
I am working on a asp.net application in which i am creating a page
I have an ASP.NET MVC3 application in which I am creating multiple areas, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.