The project illustrates how to design a simple AJAX web chat application.
We use jQuery, ASP.NET AJAX at client side and Linq to SQL at server side.
In this sample, we could create a chat room and invite someone
else to join in the room and start to chat.
Step 1. Create an ASP.NET Web Application. In this sample it is "WebChat".
Step 2. Right-click the App_Data directory, and click Add -> New Item ->
SQL Server DataBase. In this sample it is "SessionDB.mdf".
Step 3. Open the database file and create four tables.
* tblChatRoom: store chat room data.
* tblMessagePool: store the chat message data temporarily.
* tblSession: store the user session data.
* tblTalker: store the user data who in the chat rooms.
The details columns for these tables, please refer to the SessionDB.mdf
in this sample.
Step 4. Create a new directory, "Data". Right-click the directory and click
Add -> New Item -> Linq to SQL classes.(If you could not find that
template, please click the Data node of the tree view at the left
hand.) In this sample, it is SessionDB.dbml.
Step 5. Open the SessionDB.dbml and double-click the SessionDB.mdf, you will
see the database in the Server Explorer. Expand the SessionDB.mdf,
expand the Tables folder, and select the four tables, and drag them
all to the stage of the SessionDB.dbml.
http://code.msdn.microsoft.com/CSASPNETAJAXWebChat-c4c9b8fe