By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

store procedure problem

P: n/a
my stored procedure runs very well. However, as I use .net to get the
dataset .It is fail, no data returns .
what's wrong with my code ?
Please help.

With cmdSearch
.Connection = conPubs
.CommandText = "dbo.companyinfo_shipper_List"
.CommandType = CommandType.StoredProcedure
End With

prmSearch = cmdSearch.Parameters.Add("@name", 'F%'))
prmSearch.Direction = ParameterDirection.Input
prmSearch.SqlDbType = SqlDbType.Char
Dim daSearchResult As New SqlDataAdapter(cmdSearch)
conPubs.Open()
daSearchResult.Fill(dsSearchResult)

---------------------------------------------
CREATE PROCEDURE dbo.companyinfo_shipper_list
@name char(40)
as
select code,name,address1,address2,address3,address4 ,telno,faxno
from companyheader
where shippersw = 1 and name like @name
order by name

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Agnes,

I am not sure however I think you did mean something as:

cmdSearch.Parameters.Add("@name", "F%")

And than delete this part
prmSearch = cmdSearch.Parameters.Add("@name", 'F%'))
prmSearch.Direction = ParameterDirection.Input
prmSearch.SqlDbType = SqlDbType.Char

As far as I can see that does nothing.

However it is sunday, so maybe when this is not right you can ask it as well
in the newsgroup

Cor

Adonet
<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<http://communities2.microsoft.com/co...s/?dg=microsof
t.public.dotnet.framework.adonet>

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
"Agnes" <ag***@dynamictech.com.hk> wrote in message news:<e6**************@TK2MSFTNGP12.phx.gbl>...
my stored procedure runs very well. However, as I use .net to get the
dataset .It is fail, no data returns .


Agnes,

Try changing the parameter to varchar(40).

HTH
Nov 20 '05 #3

P: n/a
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
my stored procedure runs very well. However, as I use .net to get the
dataset .It is fail, no data returns .


Just FYI:

There is a separate group for .NET + database related questions
available:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
Use for this the option

echo off

Nov 20 '05 #5

P: n/a
* "Cor Ligthert" <no**********@planet.nl> scripsit:
Use for this the option


Ooops. Didn't see your reply in gnus :-(((.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.