|
-
Mar 6th, 2004, 05:49 AM
#1
Thread Starter
Member
Simple dataset question
Hi,
i have problems with dataset ?
I have public function with connected in database.
I want return that function one row in form messagebox.
Function code like this:
*Code function
cn.Open()
cmd.CommandType = 1
cmd.CommandText = "select y from XX where zz = @zz"
cmd.Parameters.Add("@zz", zz)
Dim aa As SqlDataReader
aa = cmd.ExecuteReader(CommandBehavior.SingleRow)
Return aa.GetValue(0)
When i try get that value in form, it's only show 0. What it wrong or ....
Tweety99
-
Mar 6th, 2004, 08:49 AM
#2
I wonder how many charact
I think it may be you are setting CommandType =1, which is TableDirect, which is not supported with a SQL Connection, only using an OLEDB connection.
-
Mar 7th, 2004, 03:01 PM
#3
Thread Starter
Member
Number 1 should be CommandType.Text.
Tweety99
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|