p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > .NET > Other .NET > General .NET
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 3rd, 2004, 03:14 AM
Authorized User
Points: 159, Level: 3
Points: 159, Level: 3 Points: 159, Level: 3 Points: 159, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: Delhi, Delhi, India.
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 3rd, 2004, 10:23 PM
Friend of Wrox
Points: 319, Level: 6
Points: 319, Level: 6 Points: 319, Level: 6 Points: 319, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: , , .
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 6th, 2004, 03:46 AM
Authorized User
Points: 281, Level: 5
Points: 281, Level: 5 Points: 281, Level: 5 Points: 281, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2004
Location: Delhi, Delhi, India.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mahulda
Default

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


-.. -..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
another tcp/ip related query watashi C# 2005 0 August 30th, 2007 08:31 PM
database related query dkvaseeta Pro VB Databases 2 February 22nd, 2007 10:59 AM
Repeater Control Related Query param99 ASP.NET 1.0 and 1.1 Professional 1 December 14th, 2006 04:17 AM
query related to function nimeshkumargupta SQL Server 2000 0 January 18th, 2005 04:05 AM
problems with related query apek PHP How-To 5 February 4th, 2004 02:06 PM



All times are GMT -4. The time now is 09:42 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc