February 11, 2005 at 4:33 pm
I have a two column table (identity and ntext) setup to be used by sproc and vb.net. I can NOT get this select sproc to work from vb.net but I can exec the sproc by itself? So it must be my sproc params?
I was selecting ntext through sproc and vb.net I have tried several things in sproc definition and looked on groups. My ntext will be for serialized xml about 10k to 20k. I have finished testing code and sprocs (dummy strings) insert, update, and delete but I can not get the select working?
"SqlException:A severe error occurred on the current command."
Error: 17805, Severity: 20, State: 3 Invalid buffer received from client. SQL2000SP3,
CREATE TABLE IQ] (
[InstallQuoteID] [int] IDENTITY (1, 1) NOT NULL ,
[InstallQuoteXML] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
--------------------
CREATE PROCEDURE usp_tblInstallQuote_Select
(
@Identity int,
@InstallQuoteXML ntext OUTPUT
)
AS
SET NOCOUNT ON;
Select InstallQuoteXML
from tblInstallQuote
where InstallQuoteID = @Identity
GO
---- vb.net code from select
' IDENTITY Input
sProcCmd3.Parameters.Add("@Identity", SqlDbType.Int)
sProcCmd3.Parameters("@Identity").Value = rowid
sProcCmd3.Parameters("@Identity").Direction = ParameterDirection.Input
' add itemnmbr xml parameter OUTPUT
sProcCmd3.Parameters.Add("@InstallQuoteXML", SqlDbType.NText, 1073741823)
sProcCmd3.Parameters("@InstallQuoteXML").Value = New System.Data.SqlTypes.SqlString(Nothing)
sProcCmd3.Parameters("@InstallQuoteXML").Direction = ParameterDirection.Output
Dim rowstr As String
* sProcCmd3.ExecuteScalar()
rowstr = CType(sProcCmd3.Parameters("@InstallQuoteXML").Value, String)
-------------------------------
Source Error:
Line 48: sProcCmd3.Parameters("@InstallQuoteXML").Direction = ParameterDirection.Output
Line 49: Dim rowstr As String
Line 50: sProcCmd3.ExecuteScalar()
Line 51: 'rowstr = CType(sProcCmd3.Parameters("@InstallQuoteXML").Value, String)
Line 52: 'Response.Write("row ftn=" & rowstr)
Source File: C:\Inetpub\wwwroot\INTRA0514\InstallQuoteDAL.vb Line: 50
Stack Trace:
[SqlException: A severe error occurred on the current command. The results, if any, should be discarded.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteScalar() +177
INTRA0514.InstallQuoteDAL.DbSelect(Int32 rowid) in C:\Inetpub\wwwroot\INTRA0514\InstallQuoteDAL.vb:50
INTRA0514.InstallQuote.btnSave_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\INTRA0514\InstallQuote.aspx.vb:300
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
February 14, 2005 at 8:00 am
This was removed by the editor as SPAM
February 17, 2005 at 1:42 pm
I think need to put this statement before you execute it.
sProcCmd3.CommandType = CommandType.StoredProcedure
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply