how can i let that message to be seen by a concerned person only
hi,
i am doing a project where i have to create a page sentmessage.aspx from where msges are sent which inserts the message to the sql database.and after that i have to show that message to a perticular concerned person in viewmessage.aspx retrieving from a database.how can i let that message to be seen by a concerned person only.what should i do for it.if it is possible could anyone pls tell me in detail because am new to the c#.net.
hoping for ur help
Ruchi RPosted Aug 9, 2009, 6:42 AM
Kirtan PatelPosted Aug 7, 2009, 9:34 AM
if possible
Here i have one mistake
yo have told that you have user_id field in SentMessage Table
but while you sending message I cant see that U insert value into that User_id Field
SqlCommand Mycomm = new SqlCommand("insert into tblSentMessage (MFrom, MTo, MSub, MMsg) values (@MFrom, @MTo, @MSub, @MMsg)",Myconn);
and while retrieving it from database you are user id that is null
SqlCommand MyComm = new SqlCommand("select tblSentMessage.MFrom, tblSentMessage.MTo, tblSentMessage.MSub, tblSentMessage.MMsg tblLogInDetails.dbusername from tblSentMessage INNER JOIN tblLogInDetails ON tblLogInDetails.user_Id=tblSentMessage.user_Id where tblLogInDetails.dbusername = " + MTo + " ", MyConn)
Thanks :)
Kirtan PatelPosted Aug 7, 2009, 6:15 AM
Can you Send me your Project Files in Mail ( [email protected] ) or Just upload it on
http://mediafire.com and Post Link Here
so that i can understand it better .
just mail me your file will respond you here .
Ruchi RPosted Aug 7, 2009, 5:07 AM
Kirtan PatelPosted Aug 3, 2009, 9:01 AM
add UserId of user in Session["userid"] =
and when running the query get it from session
userid = Convert.ToInt32(Session["userid"]);
select * from sentmesdetails where userid = userid;
Ruchi RPosted Aug 3, 2009, 5:47 AM
Kirtan PatelPosted Aug 2, 2009, 8:01 AM
now when you Fill Data in Grid Fill it using Where Query
take user id when user logs in and preserve in session and use it in query like below
select * from messages where user_id =
that's it
Happy Coding :)