Geeks Talk

Prepare for your Next Interview




how to run sql through vb.net

This is a discussion on how to run sql through vb.net within the SQL Server forums, part of the Databases category; how to run a sql server 2005 sp through a windows application programm designed with vb.net 2005...


Go Back   Geeks Talk > Databases > SQL Server

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-31-2008
Junior Member
 
Join Date: May 2008
Location: athens
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
gdtrigas is on a distinguished road
Exclamation how to run sql through vb.net

how to run a sql server 2005 sp through a windows application programm designed with vb.net 2005
Reply With Quote
The Following User Says Thank You to gdtrigas For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 06-06-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,330
Thanks: 7
Thanked 120 Times in 108 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: how to run sql through vb.net

What do you mena by to run a sql server 2005 sp through a windows application programm ?

are you trying to execute DML /DDL statments or something else ?
Reply With Quote
  #3 (permalink)  
Old 06-13-2008
Junior Member
 
Join Date: Jun 2008
Location: delhi
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
mailamit.jais is on a distinguished road
Re: how to run sql through vb.net

cmd = New SqlCommand("storedprocedure name", constr)

cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@variable name", SqlDbType.datatype, value).Value = selectedcontrol.SelectedItem.Value
cmd.Parameters.Add("@variable name", SqlDbType.datatype, value).Value = ddCommodity.SelectedItem.Value
constr.Open()
varable name = cmd.ExecuteReader()
Reply With Quote
The Following User Says Thank You to mailamit.jais For This Useful Post:
  #4 (permalink)  
Old 3 Weeks Ago
Junior Member
 
Join Date: Aug 2008
Location: pilani Rajasthan
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
ashish rai is on a distinguished road
Re: how to run sql through vb.net

Quote:
Originally Posted by gdtrigas View Post
how to run a sql server 2005 sp through a windows application programm designed with vb.net 2005
u can connect vb.net2005 with sql server 2005 very easily, simply write 3 lines in the code

At the top of coding page write "Imports system.data.sqlclient", then there will be 1 line after that which will come automatically showing that webform after that write "Proteced sub as sqlconnection".............After that in the connection string every time write "Data Source=ASHISH\SQLEXPRESS;Initial Catalog=museum;Integrated Security=True"...................At the place of "ASHISH" write your computers name, at the place of "museum" write your database name from which u want to connect...

Last edited by ashish rai : 3 Weeks Ago at 11:51 AM.
Reply With Quote

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved