L
lydia sista via DotNetMonster.com
hi!
I'm new to asp.net
How do you check sql did not return anything?
i mean like if i have an sql like this:
myCom as New OledbCommand("select * from product where id='sdf'",myConn)
then if there's no product with id sdf, how do i check from myCom?
any idea of what should i do?
-------------------
then just wondering how do you check that in dataset (let's say ds.tables
("product")) there is no row?
I kept getting this error:
Server Error in '/u0201098' Application.
----------------------------------------------------------------------------
----
There is no row at position 0.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: There is no row at
position 0.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception
can be identified using the exception stack trace below.
Stack Trace:
[IndexOutOfRangeException: There is no row at position 0.]
System.Data.DataRowCollection.get_Item(Int32 index) +63
PartyHouse.searchcatalogue.search_Click(Object s, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Please help... Thanks..
I'm new to asp.net
How do you check sql did not return anything?
i mean like if i have an sql like this:
myCom as New OledbCommand("select * from product where id='sdf'",myConn)
then if there's no product with id sdf, how do i check from myCom?
any idea of what should i do?
-------------------
then just wondering how do you check that in dataset (let's say ds.tables
("product")) there is no row?
I kept getting this error:
Server Error in '/u0201098' Application.
----------------------------------------------------------------------------
----
There is no row at position 0.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: There is no row at
position 0.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception
can be identified using the exception stack trace below.
Stack Trace:
[IndexOutOfRangeException: There is no row at position 0.]
System.Data.DataRowCollection.get_Item(Int32 index) +63
PartyHouse.searchcatalogue.search_Click(Object s, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Please help... Thanks..