Hej hittar ingen lösning på hur jag ska Skicka en form till Access.
public class AddNyKund : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button AddNew;
protected System.Web.UI.WebControls.Table Table1;
protected System.Web.UI.WebControls.Table TableNewKund;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
public bool Add(int KlubbNr, string Klubbnamn)
{
bool ret = true;
OleDbConnection conn = null;
try
{
conn = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Server.MapPath("db/BerlinGlolf.mdb"));
conn.Open();
string SqlCmd = "INSERT INTO Kunder(Klubbnr,KlubbNamn) VALUES (@Klubbnr,@Klubbnamn)";
OleDbCommand cmd = new OleDbCommand(SqlCmd, conn);
}
catch (Exception e)
{
Response.Write(e.Message);
Response.Write(KlubbNr);
Response.End();
}
finally
{
if (conn != null) conn.Close();
}
}
\#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// \<summary\>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// \</summary\>
private void InitializeComponent()
{
this.ID = "AddNyKund";
this.Load += new System.EventHandler(this.Page_Load);
}
\#endregion
}
}