Create Table ( USERNAME VARCHAR2(70), PASSWORD VARCHAR2(50), EMAIL VARCHAR2(30))
namespace abc { public partial class Test1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //OracleConnection ora = new OracleConnection(conn); //ora.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SID=glmjoy)));User Id=glmjoy;Password=glmjoy;"; //string qry = "insert into test1 (username) values (@txtusername)"; //OracleCommand cmd=new OracleCommand(qry,ora); //cmd.Parameters.Add("username", txtusername.Text); //ora.Open(); //cmd.ExecuteScalar(); //ora.Close(); //----------------- if (!IsPostBack == true) { inert(); } ----------- I am getting error here protected void inert() { //If a PostBack occured, then handle your Oracle Database call string conn = ""; //Create an OracleDatabase object OracleConnection ora = new OracleConnection(conn); { //Open your connection conn.Open(); //Build your actual statement (example demonstrating parameters) string sql = "INSERT INTO test1 (username) VALUES (@username)"; //Builds your command that will be executed OracleCommand cmd = new OracleCommand(sql, conn); //Populates your Parameters (examples) cmd.Parameters.AddWithValue("@Username", txtusername.Text); //Execute your command cmd.ExecuteNonQuery(); } } } }
namespace abc { public partial class Test1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { inert(); } } // This is missing. protected void inert() { // All the function codes } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)