V
vb4me
Hello.
Can anyone help with this one?
I've written an app that queries data on two linked servers (sql
server 2000).
The stored procedure runs fine when I 'exec' it in management studio,
but it times out when launched from VB2005.
The funny thing is it worked last week - I'm just not sure what has
changed since then.
Here's (some of) my vb source
Dim Conn As New
System.Data.SqlClient.SqlConnection(My.Settings.ModelstockConnString)
Dim Cmd As New System.Data.SqlClient.SqlCommand
Dim sqlstr As String
Cmd.CommandTimeout = 600
Cmd.CommandType = Data.CommandType.Text
Conn.Open()
Cmd.Connection = Conn
Dim dr As System.Data.SqlClient.SqlDataReader = Nothing
Dim dtms As New System.Data.DataTable
sqlstr = "exec MWLBringToModelstockQuery '" &
DataGridView1.Rows(0).Cells("cCustNo").ToString.Trim & "'"
Cmd.CommandText = sqlstr
dtms.Load(Cmd.ExecuteReader)
Here's my connection string
Data Source=TESTSERVER;Initial Catalog=TESTDB;Integrated Security=True
Here's my SP:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[MWLBringToModelstockQuery]
(
@custno nchar(10),
@itemno nchar(20) = '',
@storeno nchar(10) = ''
)
as
Can anyone help with this one?
I've written an app that queries data on two linked servers (sql
server 2000).
The stored procedure runs fine when I 'exec' it in management studio,
but it times out when launched from VB2005.
The funny thing is it worked last week - I'm just not sure what has
changed since then.
Here's (some of) my vb source
Dim Conn As New
System.Data.SqlClient.SqlConnection(My.Settings.ModelstockConnString)
Dim Cmd As New System.Data.SqlClient.SqlCommand
Dim sqlstr As String
Cmd.CommandTimeout = 600
Cmd.CommandType = Data.CommandType.Text
Conn.Open()
Cmd.Connection = Conn
Dim dr As System.Data.SqlClient.SqlDataReader = Nothing
Dim dtms As New System.Data.DataTable
sqlstr = "exec MWLBringToModelstockQuery '" &
DataGridView1.Rows(0).Cells("cCustNo").ToString.Trim & "'"
Cmd.CommandText = sqlstr
dtms.Load(Cmd.ExecuteReader)
Here's my connection string
Data Source=TESTSERVER;Initial Catalog=TESTDB;Integrated Security=True
Here's my SP:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[MWLBringToModelstockQuery]
(
@custno nchar(10),
@itemno nchar(20) = '',
@storeno nchar(10) = ''
)
as