|
|
 |
| General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums. If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 3rd, 2004, 03:14 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Location: Delhi, Delhi, India.
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
query related problem
I want that when i execute a select query,then the no of rews affected
by the query are to be known.
I've wrote the following code
Dim ret as integer
cmdSelect = New SqlCommand("Select Tech_Name From Technology where Tech_Name='" & Tech_Txt.Text & "' ", con)
ret = cmdSelect.ExecuteNonQuery
If (ret = 0) Then
'some operation
else
'some...
end if
but it not working,is it right way doing this.
whats the sol'n.
abhinavjain
__________________
abhinavjain
|

September 3rd, 2004, 10:23 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Location: , , .
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
whats the error u get?
try to use executeQuery insteed of executenonQuery. executeNonQuery is for insert, update and delete.
hope this help
life's Ng
|

September 6th, 2004, 03:46 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Location: Delhi, Delhi, India.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If nothing works then try out this
Dim ret as integer = 0
Dim myreader
cmdSelect = New SqlCommand("Select ....., con)
myreader = cmdSelect.ExecuteReader
While myreader.read()
ret += 1
End While
myreader.close()
con.close()
If (ret = 0) Then
'some operation
else
'some...
end if
-.. -..
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |