MS Access vs Silverlight

•MS Access is used as a backend.
• we need Web Service for connecting the database with Silverlight.
•Connecting MS Access with Silverlight is a simple than connecting it with SQL server.
•Silverlight + Access Database will give a rich application
eg:
public class Service1 : System.Web.Services.WebService
{ OleDbConnection con;
OleDbCommand cmd;
OleDbDataAdapter da;
DataSet ds;
[WebMethod]
public string Hello()
{
return "hai";
}
[WebMethod]
public string detail(string emp_id, string emp_name, string emp_dept)
{
string query;
con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\TenthPlanet\\emp_table.mdb");
con.Open();
try
{
query = "insert into table1 values(" + emp_id + ",'" + emp_name + "','" + emp_dept + "')";
cmd = new OleDbCommand(query, con);
cmd.ExecuteNonQuery();
da = new OleDbDataAdapter("select * from Table1", con);
ds = new DataSet();
da.Fill(ds);
return "inserted succ";
}
catch (Exception e)
{
return e.Message ;
}

Comments

Popular Posts