heres my aspx page:
<%@ Page Language="C#" src="nns2007.aspx.cs" Inherits="_nns2007" %>
<html>
<title>The 7th National Nutrition Survey, year 2007</title>
<head>National Nutrition Survey 2007</head>
<body>
<form id="form1" runat="server">
<table>
<tr>
<td><input type="text" id="txtareacode" maxlenght="25"></td>
</tr>
<tr>
<td><input type="text" id="txtht" maxlenght="5"></td>
</tr>
<tr>
<td><input type="text" id="txtwt" maxlenght="5"></td>
</tr>
</table>
</form>
</body>
</html>
my code behind:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Web.UI.HtmlControls;
public partial class _nns2007 : System.Web.UI.Page
{
void connectoDB(string sql)
{
string connectionString =
"Server=localhost;" +
"Database=anthro;" +
"User ID=root;" +
"Password=sabukot;" +
"Pooling=false";
IDbConnection dbcon;
dbcon = new MySqlConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
}
void AnthroInsert()
{
string a_INSERT = "INSERT INTO anthro(areacode,height,weight) VALUES (txtarea,txtht,txtwt)";
connectoDB(a_INSERT);
}
protected void btnInsert_Click (object sender, EventArgs e)
{
AnthroInsert();
}
}
by the way, what version of mysql connector should i use 1.0.5? i