Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi EXPERTS,

am working on asp.net project using C# and SqlServer 2005 database.

On my webpage i have a submit button, and textboxes in gridview footer.... this should check the database table if it contains any records.

My requirement is.............

I have a table name(Directory)

When i click on submit button, it should check......if the table conatins more than one row null. it should display a message. Please enter the details.

Just this is my requirement, this must be done in submit button.

Please help thanks
Posted
Comments
Maciej Los 11-May-13 4:20am    
What have you done so far? Where are you stuck?
David_Wimbley 12-May-13 12:59pm    
This is pretty basic...so basic i think im over complicating the answer. For example all you would have to do is the following query and grab the "answer" using your preferred data access layer

SELECT
CASE
WHEN COUNT(*) = '0' THEN 'THERE ARE NO NULL ROWS'
ELSE 'CONTAINS NULL ROWS' END AS NullRowCounter
FROM YourTableNameHere WHERE FileNameThatShouldBeNull IS NULL
Varun Sareen 27-May-13 6:32am    
exactly David 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900