how to insert a record from mobile application into database?
-
29. dubna 2007 15:37HI,
I am making a project for pocket pc in VS 2005. It is a university's website not a actual website but a demonstration of my project. I want my users to give their name and address using this website to order a prospectus. So when I deploy my application and insert name and address from application which should go into my database I created in SQL server Mobile edition named as university.sdf. The record does not go into the database. I refreshed the database. I am watching the same database which is running but it is not showing the record in the datatable. I am sending you a copy of my code.
private void btnSubmit_Click(object sender, EventArgs e)
{
SqlCeConnection con = new SqlCeConnection();
con.ConnectionString = ("Data Source = "
+ (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\university.sdf;"));
SqlCeCommand cmdAddPros = new SqlCeCommand();
cmdAddPros.Connection = con;
cmdAddPros.CommandText = String.Format("insert into ProspectiveStudent (Name,Address,PostCode) Values('{0}','{1}','{2}')", txtName.Text, txtAddress.Text, txtPostCode.Text);
con.Open();
int intcount = cmdAddPros.ExecuteNonQuery();
con.Close();
}
if anyone can help me I will be grateful
Odpovědi
-
29. dubna 2007 19:37Moderátor
Všechny reakce
-
29. dubna 2007 19:37Moderátor
-
30. dubna 2007 18:11
Thankyou Ilya for these links. I think it will sort out my problem. If I will have any problem I will come back to you. I have another query that Is it possible to put a project made in VS 2005 like mine on the web server to see on desktop like this http://home.m-learning.net/learn/iframe_page.htm
I have web space. If it is possible than which files should I copy on my webspace so that my project can be seen like in the above link.
tell me if anyone know about it.
Thanks,
Ambreen