Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access stored procedure to sql server equivalent

Posted on 2006-06-27
2
Medium Priority
?
167 Views
Last Modified: 2010-04-23
My stored procedure looks like this in vb.net 2003 ... what would the equiv look like in if I were using sql server...
Dim spName As String
        Dim spSearch As String
        Dim Row As Integer

        odaRate.SelectCommand = New OleDb.OleDbCommand
        With odaRate.SelectCommand
            .CommandType = CommandType.StoredProcedure
            .Parameters.Add("spZip", OleDbType.VarChar, 10).Value = mskOZip.ClipText
            .CommandText = "spZipSearch"
            .Connection = cnnRate
        End With
        dsRate.Clear()
        Try
            odaRate.Fill(dsRate, "Zip")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        Me.dtgTest.DataSource = dsRate.Tables("Zip")
0
Comment
Question by:michaelbuller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 16995800
It would look exactly the same, except you would change "OleDb.OleDbCommand" and "OleDbType.VarChar" to "SqlClient.SqlCommand" and "SqlDbType.VarChar" respectively.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 16995816
Alternatively you could connect to SQL Server using the OleDb data objects rather than the native Sql objects; in which case you wouldn't have to change anything.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question