also i would like to know whether i have to use a oracle connection or oledb connection
i got many forums but i am confused actually it would have been a great help if anyone could explain me step by step
namespace WebApplication1
{
/// <summary>
/// Summary description for busarea.
/// </summary>
public class busarea : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Button Button3;
protected System.Data.OleDb.OleDbConnection oleDbConnection1;
protected System.Data.OleDb.OleDbCommand oleDbCommand1;
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#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.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.oleDbCommand1 = new System.Data.OleDb.OleDbCommand();
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
//
// oleDbConnection1
//
this.oleDbConnection1.InfoMessage += new System.Data.OleDb.OleDbInfoMessageEventHandler(this.oleDbConnection1_InfoMessage);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
string str = ConfigurationManager.appsettings["ConnectionString"].ToString();
OleDbConnection oracleConn = new OleDbConnection();
oracleConn.ConnectionString=str;
con.open();
OleDbCommand cmd = new OleDbCommand("Write your insert statement here like INSERT INTO TABLENAME VALUES (“YOUR VALUES", con);
OleDbDataReader dr = cmd.ExecuteReader();
}
private void Button3_Click(object sender, System.EventArgs e)
{
}
}
}
This post has been edited by geeteshss: 22 June 2007 - 03:35 AM

New Topic/Question
Reply





MultiQuote






|