473,382 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

store procedure problem

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
5 897
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
"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
* "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
Use for this the option

echo off

Nov 20 '05 #5
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alessandro | last post by:
Hi, here is the problem... I must create a store procedure that do the following... 1. select id_name,...'some other field' from table 'data' where 'criteria' = @parameter 2. use the result...
2
by: serge | last post by:
My project is to automate testing of Stored Procedures of type SELECT (at least for now). I want to create a table where each stored procedure's input parameter values are entered and in another...
7
by: George | last post by:
Hi , I am getting the below error while i am invoking a Java stored procedure from another java stored procedure. SQL0751N Routine "" (specific name "") attempted to execute a statement...
1
by: Hugo Lefevre | last post by:
Dear, I have a problem : I have a database which contains my data of hardware. The Id is a varchar and I want at my filling form that my user know which is the last one. So I made a store...
4
by: Iwan Petrow | last post by:
Hi, I have a store procedure like this: CREATE PROCEDURE AAA @p1 int @p2 datetime @id int OUTPUT AS
2
by: Benny Ng | last post by:
The authentication code of enterprise libiary like the following: IAuthenticationProvider authenticationProvider = AuthenticationFactory.GetAuthenticationProvider(); IIdentity identity;...
1
by: TARUN | last post by:
Hello All I get stuck in one problem , Please help me and excuse me on the poor Knowledge in SQL Server Store procedure Q1...I want to return a string type value from store procedure , Is it...
0
by: rxding | last post by:
Hello, Performance reason we need to move some of our code into database. Java Store Procedure is given the first choice. However, while investigating some sample code of Java store procedure, ...
1
by: eRTIS SQL | last post by:
hi, I want to use a stored procedure inside a stored procedure simulteanously changing the database. this is my base store procedure alter PROCEDURE create_file @dbname sysname AS declare...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.