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 9124573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:36:09+00:00 2026-06-17T06:36:09+00:00

Using Visual Studio 2010 I have created a VB Web Application which I added

  • 0

Using Visual Studio 2010 I have created a VB Web Application which I added a database to. I have a VB class which is suppose to take a name and add it to the database through a stored procedure. I run the code and it passes the variable to the vb class but doesn’t seem to change the table once I’ve stopped running the program.

I’m new to the vb and visual studios thing so I’m using http://www.macronimous.com/resources/calling_stored_procedures_from_ASP.NET_and_VB.NET.asp as my guide which is why the code is the way it is.

Here is the vb class

Imports System.Data
Imports System.Data.SqlClient

Public Class human

Private name As String
Private id As Integer

Public Function sendName(ByVal nm As String)

    Dim SQLCon As New SqlClient.SqlConnection
    Dim SQLCmd As New SqlCommand
    SQLCon.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=
 C:\Documents and Settings\user\my documents\visual studio 2010\Projects\
 WebApplication3\WebApplication3\App_Data\Database1.mdf;
 Integrated Security=True;User Instance=True"

    SQLCon.Open()
 'I want to to execute the procedure addName using the variable nm
    SQLCmd.CommandText = "addName"
    SQLCmd.CommandType = CommandType.StoredProcedure
    SQLCmd.Parameters.AddWithValue("@name", nm)
    SQLCmd.Connection = SQLCon 'Active Connection
    SQLCon.Close()

    Return (nm)
End Function

End Class

and here's my stored procedure "addName"
Alter PROCEDURE addName (@GivenName varchar(100))
AS
BEGIN
SET NOCOUNT ON;
Insert into tableA (name) values (@GivenName);
END
return

What am I missing that prevents the table from showing updates after I stop debugging the application?

  • 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-17T06:36:11+00:00Added an answer on June 17, 2026 at 6:36 am

    Great. You define a command, you create a connection and open it. But you fail to execute the command.

    SQLCmd.Connection = SQLCon 'Active Connection
    SQLCmd.ExecuteNonQuery()
    SQLCon.Close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a web application using ext.net and c# in visual studio 2010.
I have created a web application using Visual Studio 2010 on a Windows Server
I have created SQL Server 2008 Database project using visual studio 2010. after build
I have created a sample web application in Visual Studio 2010. It stores Membership
I'm currently using Visual Studio 2010 and have created a 'ASP.NET MVC 3 Web
I have created a new WPF Application using Visual Studio 2010 so I have
I am using DotNet.Highcharts in conjunction with Visual Studio 2010. I have created an
i am using visual studio 2010. i have a three dimensional structure array which,
I deployed my web application created with visual studio 2010 to a remote server
I am using visual studio 2010 and tried to create a class library which

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.