This is the correct approach but in order to meet the requirement of needing C# code you also need to return a value from the SQL, preferably as a stored procedure. So if the count is >0 for a particular query, then return an integer to the c# app from the stored procedure.
HTH. Chris On Jun 1, 8:47 pm, KeidrickP <[email protected]> wrote: > where is the query that you used? > you may want to use something like this, if you have thousands of records in > your table.. > > IF EXISTS(SELECT top 1 yourcoulmn from YourTable) > > or something like this with fewer records > > IF (SELECT count(Column1) from YourTable) > 0 > > On Sat, May 29, 2010 at 5:32 AM, Puspanjali Jena > <[email protected]>wrote: > > > Hi All, > > I need to check data inside the table of sql server.If the data exist,it > > show the existence of data.Actually i used for loop for checking, > > but it didn't give proper result.so i need help from u that how to check > > exist data in sql server using dataset?I need coding in c#. > > > Thanks in advance > > -- > Keidrick Pettaway > > http://kpettaway.com
