|
-
Nov 15th, 2002, 02:23 AM
#1
Thread Starter
Member
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
-
Nov 15th, 2002, 03:36 AM
#2
Addicted Member
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.
-
Nov 15th, 2002, 04:11 AM
#3
Frenzied Member
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.
-
Nov 15th, 2002, 08:54 AM
#4
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|