|
If we have a database where we can store all the users list.If any of them are in online we want to conference chat with all the online users.Is any code available for this conference.I attach one code with this mail .In that code we can chat with one -to-one users as in gmail or rediff web application.But if i want to chat with more than one users like conference chat in yahoo messenger,what changes i need.if i specify the window name by any string not with users name specifing by a variable,the conference is possible.Please help sir .I want to implement this in my project.Early u people send some links to me ,but all are using dlls so i cant integrate it in my pjct.Kindly help....The code is attached below.
//Code to send msg to the online user
protected void BtnSend_Click(object sender, EventArgs e)
{
string toUserName;
string chatMsg;
DateTime chatDate;
string fromUserName;
try
{
fromUserName = User.Identity.Name;
toUserName = HidToUser.Value;
MembershipUser objMemberTo = Membership.GetUser(toUserName);
if (objMemberTo.IsOnline == false)
{
lblMsg.Visible = true;
lblMsg.Text = toUserName + "is Offline now. ";
}
chatMsg = ChatText.Text;
chatDate = System.DateTime.Now.ToLocalTime();
string fromUserID, toUserID;
MembershipUser objMemberFrom = Membership.GetUser(fromUserName);
fromUserID = objMemberFrom.ProviderUserKey.ToString();
//MembershipUser objMemberTo = Membership.GetUser(toUserName);
toUserID = objMemberTo.ProviderUserKey.ToString();
if (!string.IsNullOrEmpty(ChatText.Text))
{
if (ChatText.MaxLength <= 4000)
{
db_chat.InsertChatMessage(fromUserID, toUserID, chatMsg, chatDate, false);
}
}
DisplayChatMessage();
Label1.Text = "tony";
lblMsg.Text = "hai";
}
finally
{
}
}
protected void DisplayChatMessage()
{
DataTable dtChatMsg;
string fromUser;
string toUser;
string toUid, fromUid;
fromUser = User.Identity.Name;
toUser = HidToUser.Value;
MembershipUser objMemberTo = Membership.GetUser(toUser);
toUid = objMemberTo.ProviderUserKey.ToString();
MembershipUser objMemberFrom = Membership.GetUser(fromUser);
fromUid = objMemberFrom.ProviderUserKey.ToString();
DateTime loginTime = new DateTime();
loginTime = objMemberFrom.LastLoginDate;
dtChatMsg = db_chat.GetChatMessage(toUid, fromUid, loginTime);
DataColumn dc = new DataColumn("UserName");
dc.DataType = System.Type.GetType("System.String");
dtChatMsg.Columns.Add(dc);
if (dtChatMsg.Rows.Count > 0)
{
foreach (DataRow dr in dtChatMsg.Rows)
{
if (dr["FromUser"].ToString() == fromUid)
{
dr["UserName"] = "me";
}
else if (dr["FromUser"].ToString() == toUid)
{
dr["UserName"] = toUser;
}
}
Chatlist.DataSource = dtChatMsg;
Chatlist.DataBind();
}
}
}
|
|
|
|
|
I set all my business layer classes as sealed class. I did like this because I read from somewhere that this will improve the performance. Is it true?
Thanks and Regards,
Hogan
|
|
|
|
|
hogan.smith wrote: I read from somewhere that this will improve the performance. Is it true?
I set the class as sealed class when I want to prevent derivation.. That's all. I never heard that the sealed class is better than the normal class..
|
|
|
|
|
A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class. Sealed classes are primarily used to prevent derivation. Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster.
I copied the above sentance from MSDN 2005
Thanks,
Hogan
|
|
|
|
|
CREATE PROCEDURE CREATENEWS @strtitle nvarchar(500), @strDescription nvarchar(800), @strDate nvarchar(50), @categoryid int, @type int, @content ntext , @ivalue int out
AS
Begin
SET NOCOUNT ON
INSERT INTO tblNews (title, description,datepost, categoryid, typenews, content)
VALUES (@strtitle, @strDescription, @strDate,@categoryid, @type, @content)
SET @ivalue = SCOPE_IDENTITY()
END
GO
How can i get @ivalue or SCOPE_IDENTITY() asp.net
|
|
|
|
|
1. Return the SCOPE_IDENTITY() from stored procedure
2. Use ExecuteScalar to get this value.
|
|
|
|
|
|
Hello Everyone,
I did a little searching around and couldn't find a good answer to this problem. I have multiple files, of multiple file types, that I would like to push to the client side with one button click. I'm doing one at a time just fine in the following fashion:
PDFGenerator oPDFGenerator = new PDFGenerator();
byte[] oByte = oPDFGenerator.Genereate52670a1PDF(Page.Request.PhysicalApplicationPath);
if (oByte != null)
{
this.Page.Response.ContentType = "application/pdf";
this.Page.Response.AddHeader("Content-Disposition", "attachment; filename=52670a1.pdf");
this.Page.Response.BinaryWrite(oByte);
this.Page.Response.Flush();
this.Page.Response.End();
}
Any idea on how I could pull this off with multiple files? Thanks for any suggestions in advance,
Ryan
|
|
|
|
|
u will have to zip the files and then display..
|
|
|
|
|
Hi gurus.
I need to create floor map for each (4 floors) floor in my company new building.
Map should be similar to Google maps i.e. when map is viewed (image) I want to show employee names in their cubicles. When specific person is searched I want to show where he seats (just that person). Employee (name) should be tied to Office Communicator (IM), which shows status of the person. I can get employee information from Active Directory (name, title, email, etc.)
Did anyone have any experience doing this? Any help would be greatly appreciated.
If I didn't explain good enough let me know and I will try as best as I can.
Thank you all,
Alex.
|
|
|
|
|
Don't cross post. Pick either this forum or the VB.NET forum and wait for a reply
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
I already got this response. Thank you. Didn't know but now do. How about answer 2 my question?
|
|
|
|
|
hi,
how to import All Excel table and store data in ms access in asp.net.
and i wanna make connection to Excel,
How to make connection to Excel , just like Sql server
Raushan
|
|
|
|
|
raushan raj wrote: How to make connection to Excel , just like Sql server
Google not working in India today?
Search for 'Jet Excel OLEDB' and you'll find what you're looking for.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
Amol M Vaidya wrote: Thats a very helpful answer...or may be ur help side on leave today.
Huh? It was a helpful answer - I suggested use Google to search for the answer and gave him the search criteria. This is a common question and a bit of initiative on his part would have helped him find the solution.
Amol M Vaidya wrote: REMEMBER THAT THE CONNECTION STRING IS THE KEY
Don't you know that it's rude to shout in the forums? If you are not familiar with forum etiquette, I suggest you familiarize yourself with the forum guidelines before you post again.
BTW, it might have been better to have posted your solution to the original poster - I already know how to connect to Excel using .NET!
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi all,
What are the best books on ASP .NET for Begginners and Intermediates? any famous exceptional books?
By the way, I am very good in C, C++, and C#
Thank you
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
There are numerous good books out there on ASP.NET. Take a look on amazon This site is a great resource, as well.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Hello,
If you are good at programming then i suggest that you read web basics and straightway start coding.
Note that your trusted partner for any web help is
http://www.w3schools.com/[^]
U wont need anything beyond that for the basic stuff.
About Books..ASP.NET Unleashed is a nice 1
Regards,
Amol
|
|
|
|
|
All are good books dear, no buk is bad.
Since u r gud in c,c++, c# so lets begin coding and refer online.
manoj Kumar Jha
"Learn to smile at every situation. See it as an opportunity to prove your strength and ability."
|
|
|
|
|
Hey People,
I am looking for a tool (I'm using visual studio 2005) to that allows me to input work shifts. It can be similar to using a DateTimePicker. I have some idea's on how to do it using multiple datetimepickers, but I was hoping there would be a ready-made tool or piece of code somewhere to save me the time of re-thinking it all. That, and I'm only a beginner at this stuff, so I might overlook some things easily.
The idea is that the customer can easily input his 'factory' total working hours by selecting end time, start time, break time, weekend shifts etc so he does does not have to calculate it himself manually. Writing just the end time, start time, break time, weekend shifts etc into a database is sufficient, as I have another VB application that will pull the data out and calculate total availability, operating time etc and put it back into the database again. The reason for using multiple system is because the total system is huge and the data is needed frequently throughout the system.
Basically all I need is an easy-to-use and complete interface screen, the database bit I can do myself.
Thanks in advance on any help!
|
|
|
|
|
Probably wouldn't be too hard to make a control to do this.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Send me code of asp.net for store prosidure
ishan
|
|
|
|
|
Right away sir, would you like your shoes shined too while im at it?
|
|
|
|
|