I'm working on a gmail like mail application. In that I have created sign up sign in and creating mails and displaying the inbox with received mails. To display inbox I folloed the following procedure. First I created a database called getdata and stored the mails of all users in that database. When ever a user logs into his account I used the following code to display his mails from the whole database
public static DataSet Get_Data_id(string mailid, int Sno)
{
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from AddData where Sno='" + Sno + "' and EmailID='" + mailid + "'";
ds = SQLHelper.ExecuteAdapter(cmd, CommandType.Text, cmd.CommandText);
return ds;
}
I have given every user a serial number. Using serial number and his mail id I filled his/her inbox. Now the thing is I need to move those messages into separate folder I have a check box for every mail in inbox and by clicking on that a drop down window appears just like in gmail. But I'm getting a doubt like do I need to move all mails into separate database..? In that case I need a plenty of databases like one database for one folder. And there is also another problem like every user will have different folder names. How to overcome it. How should I design the db and how to move the mails into separate folders for each user ?