Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Call a stored procedure from ado.net and pass parameter to it ?

Answer Posted / naresh

Private Sub btnSave_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnSave.Click
connection = New SqlConnection("Integrated
Security=sspi; database=naresh; data source=TECH-FATIMA1")
Try
connection.Open()
command = New SqlCommand("spEmployee_Insert")
command.Connection = connection
command.CommandType =
CommandType.StoredProcedure
command.Parameters.AddWithValue("@Name",
txtName.Text)
command.Parameters.AddWithValue("@Dept",
txtDept.Text)
command.Parameters.AddWithValue("@Address",
txtAddress.Text)
Dim result As Integer
result = command.ExecuteNonQuery()
If result > 0 Then
MessageBox.Show("Sucessfully Stored In
Database")
End If
Catch ex As Exception
MessageBox.Show("DataBase Connection Problem")
Finally
connection.Close()

End Try
End Sub

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does ado stand for in ado.net?

1199


What is DataRowCollection?

1152


Is ado.net an orm?

1008


What is ado.net full form?

1039


Does sqlclient and oledb class share the same functionality?

984


What are the advantages and disadvantages of using datalist?

1149


Does ado.net use odbc?

999


What is ado and dao?

1007


Describe the disconnected architecture of ADO.NET’s data access model.

1112


What is the difference between ado.net and entity framework?

1099


Why is it important to close an ado.net application?

1078


What are good ado.net object to replace to ado recordset object.

1208


What is the purpose of using adodb?

1017


What are the 3 major types of connection objects in ado.net?

1054


What is the role of the dataset object in ado.net?

1155