Results 1 to 4 of 4

Thread: Please help on stored procedure issue

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Location
    a
    Posts
    40

    Talking Please help on stored procedure issue

    I've create a application to execute a store procedure and it work on my developer machine but it doesn't work when i deploy it at Win98 PC, it seem that doesn't connect to the Sql server. Do i need to include any reference item into my setup package?
    Could anyone give me some advise.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'On Error Resume Next
    Dim PubsConn As OleDbConnection = New OleDbConnection("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Grph400;Data Source=ing-spdehv;")
    Dim testCMD As OleDbCommand = New OleDbCommand("Sp_Grplimit", PubsConn)
    testCMD.CommandType = CommandType.StoredProcedure
    'Dim RetValue As OleDbParameter = testCMD.Parameters.Add("Retvalue", OleDbType.Integer)
    'RetValue.Direction = ParameterDirection.ReturnValue

    Dim Contractnumber As OleDbParameter = testCMD.Parameters.Add("@ContractNumber", OleDbType.Char, 8)
    Contractnumber.Direction = ParameterDirection.Input

    Dim PolicyPeriodFrom As OleDbParameter = testCMD.Parameters.Add("@PolicyPeriodFrom", OleDbType.Numeric, 8)
    PolicyPeriodFrom.Direction = ParameterDirection.Input

    Dim PolicyPeriodTo As OleDbParameter = testCMD.Parameters.Add("@PolicyPeriodTo", OleDbType.Numeric, 8)
    PolicyPeriodTo.Direction = ParameterDirection.Input

    Contractnumber.Value = TextBox1.Text
    PolicyPeriodFrom.Value = TextBox2.Text
    PolicyPeriodTo.Value = TextBox3.Text
    PubsConn.Open()

    Dim Myreader As Integer = testCMD.ExecuteNonQuery
    MsgBox("Done!")
    End Sub
    kelvin

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    Don't know why it wouldn't work, but you should be using sqlclient object rather than oledb if you are connecting to sql server - much better performace.
    Wind and waves resolves all problems.

  3. #3
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I think you have to tell your clients where to read the data from. Before you build your deployment project look into your app.config file and add an entry under <appSettings> that reads like this:

    <add key="pubsConn.ConnectionString" value="here you should insert a connection string that is not specific to your developing machine but general" />

    Or maybe the application should find the sql server location by itself and fix the connection string using that data.

  4. #4
    Lively Member freightliner's Avatar
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    123
    is your framework installed??
    very handy: [vbcode][/vbcode]
    VB.NET - VB6 - VBA - ASP - RPG(AS/400) - C++ - java - SQL

    look in the help, many probs can be solved that way.
    I know, i'm to lazy too.

    PLEASE PUT RESOLVED IF RESOLVED!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width