Click here to Skip to main content
15,881,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually i have two module

1.user module-user register the complaint it was store in database table
2.admin module-read the complaint and want to solved

now i did user complaint show in following format in gridview
image link

subject - username-date-msgtype

now those msg i didn't unread i wanna make those msg icon as unread and after i read the msg inbox automatically tat icon was change into read...

how can we do this please help me???
Posted
Updated 27-Aug-13 21:57pm
v5
Comments
joshrduncan2012 26-Aug-13 13:34pm    
Help you with what? What have you tried so far to accomplish this?
Deenuji 28-Aug-13 1:22am    
how insert the image while we post the complaint in user panel??? coz if v using file upload control means v can do it easily...without fileupload control how to set icon image to all column value as default????
Dholakiya Ankit 28-Aug-13 4:54am    
take one extra field like read/unread in datbaase 1 for read 0 for unread that will be solution for u
Deenuji 28-Aug-13 5:03am    
k but how can to insert image into database as default while we post the complain.....i tried using filepath but i cant able to insert tat image as binary format....so how it is possible???
Dholakiya Ankit 28-Aug-13 5:12am    
post that code what u have tried
?

I was unable to see the image you have provided along with your query. As far as I have understood, your system doesn't know that the message has been read. So, first you have to make your system understand that you have read a message. For that you can have another column in your database with a default value of 'unread message' against each message; once you click on that message to read it, update that column's value to 'read message'. Show appropriate images against both values in the grid. Instead of a string message, better store these values in the form of boolean value. If a message is unread, it is false, otherwise true. And yes update your values in the cache/memory instantly so that you can have the true value against each message throughout the application.
 
Share this answer
 
Comments
Deenuji 28-Aug-13 1:21am    
ya u r correct but how insert the image while we post the complaint in user panel???
coz if v using file upload control means v can do it easily...without fileupload control how to set icon image to all column value as default????
C#
FileInfo image = new FileInfo(context.Server.MapPath("~/Product_Images/Image-under-update.gif"));
string image1 = image.ToString();
byte[] buffer = File.ReadAllBytes(image1);
// here you will get binary data which you can insert into database
context.Response.BinaryWrite(buffer);



regards...:)
 
Share this answer
 
Comments
Deenuji 28-Aug-13 5:25am    
i ll try and come back to here...thanks for ur solution
Deenuji 28-Aug-13 5:39am    
i didnt use context in ur given coding ...

getting this error:

Implicit conversion from data type varchar to binary is not allowed. Use the CONVERT function to run this query.

my insert query is:

insert into user_senditem(user_senditem_id,username,user_id,department_id,attached_files,subject,message,compl_nature,compl_type,group_id,apartment_id,area_id,date_time,type,created_on,created_by,Image) values('SI00000054','FL00000008','USER000006','Admin','@DocData','df','dfdf','Complaint','Urgent','GP00000002','AP00000002','AP00000002','28/08/2013 02:59:32 PM','N','8/28/2013 3:05:21 PM','deenu','System.Byte[]' )
Dholakiya Ankit 28-Aug-13 5:58am    
use only server.mappath deenuji
Deenuji 28-Aug-13 6:01am    
s i use like that only ....but conversion error came bro:)
Dholakiya Ankit 28-Aug-13 8:23am    
its okay

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