Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Wednesday, March 28, 2012

I dont know how to use storedProcedure that returns one value as a result to a VB calling

My stored procedure works perfectly when I run Query Analyser, but when I run my VB program I get the eror: I get the message : An SqlParameter with ParameterName'@.total' is not contained by this SqlParameterCollection.


Here is my stored Proc and my VB program is right below

I- Stored Proc:

CREATE PROCEDURE dbo.totalsub
@.account bigint,
@.total bigint output
AS
select total=sum(SubPhnNmbr) from tblsub whereSubAccNmbr=@.account
return
GO

II- And my pogram in VB is:

Dim totsub As Int64
Dim cm As New SqlCommand
Dim cn As New MyConnection
cn.open
'my connection is defined by me don't worry about it
cm.CommandType = CommandType.StoredProcedure
cm.CommandText = "totalsub"
cm.Connection = cn
Dim pm As SqlParameter
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Account", System.Data.SqlDbType.BigInt))
pm.Value = 100000165
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("total", System.Data.SqlDbType.BigInt, 4))
pm.Direction = ParameterDirection.Output
totsub = cm.Parameters("total").Value
cm.ExecuteScalar()
totsub = cm.Parameters("total").Value


I also tried using @.total instead of total and I tried ParameterDirection.ReturmValue instead of ParameterDirection.Output

No Luck, someone pls can help

check the second part ofthis article.|||Thanks.

Monday, March 12, 2012

I can not enter non english text in SQL express...

I am trying to add non English text in a table in my sql express but when it refreshes the entry returns unrecorgizable characters(@.#$@.)

Haw may I configure sqlexpress languages or is there something else I should know?

Many thanks in advance

Are your column types nchar/nvarchar/ntext or are they just char/varchar/text?

In order to use international strings, you must store the data with wide character types.

|||

Hello,

I had no idea about it... I will change the field type

Thanks

Wednesday, March 7, 2012

hyphens change between w2K and w2K3 ???

On one system a search for 21-147 returns 1 result - which is the
correct way I need it to work.
However on my new system, this does an OR search, returning all results
with 21 in, and all results wth 147 in which clearly returns hundreds.
These are product part numbers, they /must/ be searchable as they look
on the printed litereature, prefereably only returning 1 correct
result!
I've tried all sorts of things, changing the collation, changing the
word breaker langauge etc
The only other diffrence now is that the first system is on Windows 2K,
and the new one that doesn't work is on Windows 2K3.
As a small fix, i looked for the - and replaced it with an AND. However
some part numbers are of the form N-234S and as such the initial letter
is removed by the noise list and the search returns no results.
This is REALLY important any help would be very greatly appreciated. I
have weeks to get htis working, or the entire web project is down the
pan.
Other info, using commerce server 2002.
Thanks in advance,
Martin
I think you'll have to use another character. For instance have two copies
of your data, one for show and one for indexing. Replace hyphenated words
and numbers with something like 123HYPHEN234.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Martin" <bigmarts@.hotmail.com> wrote in message
news:1131125590.462357.125330@.z14g2000cwz.googlegr oups.com...
> On one system a search for 21-147 returns 1 result - which is the
> correct way I need it to work.
> However on my new system, this does an OR search, returning all results
> with 21 in, and all results wth 147 in which clearly returns hundreds.
> These are product part numbers, they /must/ be searchable as they look
> on the printed litereature, prefereably only returning 1 correct
> result!
> I've tried all sorts of things, changing the collation, changing the
> word breaker langauge etc
> The only other diffrence now is that the first system is on Windows 2K,
> and the new one that doesn't work is on Windows 2K3.
> As a small fix, i looked for the - and replaced it with an AND. However
> some part numbers are of the form N-234S and as such the initial letter
> is removed by the noise list and the search returns no results.
> This is REALLY important any help would be very greatly appreciated. I
> have weeks to get htis working, or the entire web project is down the
> pan.
> Other info, using commerce server 2002.
> Thanks in advance,
> Martin
>
|||That's crazy. Any other suggestions...? It works on one machine, I
must be able to get it to work again...? Can I not copy the
wordbreaker dll from a win 2K machine onto Win 2K3. And what does it
have to do with the OS anyway. Surely this is a DB issue. Wierd.
Also the reason we can't really get rid of the hyphens is due to the
fact that 21-147 and 21147 are two different parts. Silly I know, but I
have to work with it.
|||Are you using FreeText of Contains? I think a contains might work for you.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Martin" <bigmarts@.hotmail.com> wrote in message
news:1131363687.867237.149540@.g49g2000cwa.googlegr oups.com...
> That's crazy. Any other suggestions...? It works on one machine, I
> must be able to get it to work again...? Can I not copy the
> wordbreaker dll from a win 2K machine onto Win 2K3. And what does it
> have to do with the OS anyway. Surely this is a DB issue. Wierd.
> Also the reason we can't really get rid of the hyphens is due to the
> fact that 21-147 and 21147 are two different parts. Silly I know, but I
> have to work with it.
>
|||It's a commerce server routine. I think it uses FREETEXT. But trying
it in query analyser works on the w2K machine for CONTAINS and
FREETEXT, but for niether on the W2K3 machine.
Any Microsoft people around? Can I use the W2K wordbreaker dll on the
2003 server machine...? It seems that this is what's causing the
problem.
Thanks,
MArtin