Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


plaese help me friend,

any product image are blank image those product image are display first in my webpage.
Posted
Updated 28-Jul-14 19:52pm
v2
Comments
_Amy 29-Jul-14 1:38am    
What have you tried? Where you stuck?
Thanks7872 29-Jul-14 1:44am    
Glad to see you after a long time. :-)
_Amy 29-Jul-14 1:49am    
:) Back to home.
Gihan Liyanage 29-Jul-14 1:39am    
Please tell some more about your requirement. Cant Understand What you want.
parmarnd 29-Jul-14 1:53am    
hi sir,

any product image are blank image those product image are display first in my webpage.

1 solution

please see the Example below

http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspx[^]

In your problem, you can change the SQL query to get blank images first.

SQL
select * From [YourTable]
ORDER BY CASE WHEN [ImagePathField] IS NULL THEN 0 ELSE 1 END, [ImagePathField] 


Example for Small table.

SQL
select * From Emp1
ORDER BY CASE WHEN Name IS NULL THEN 0 ELSE 1 END, Name



Use This and first see the SQL result is correct. You need to come null values first in the output.

Please Marked as Answered, if you got a help.
 
Share this answer
 
v2

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