Update


update values in your table using oracle comands.. before using this you must create the table like hear application


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 System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
string connstring = "Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = " + "inca81" + " )(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = " + "tm" + "))); User Id =" + "test" + "; Password = " + "test" + ";";

string qstring;
qstring = "select * from APPLICATION";
Oracle.DataAccess.Client.OracleConnection connection = new Oracle.DataAccess.Client.OracleConnection(connstring);

try
{
connection.Open();
{
Console.WriteLine("connection opened");
Console.WriteLine("connection properties");
Console.WriteLine("connectionstring:(0)", connection.ConnectionString);
Console.WriteLine("server version :(0)", connection.ServerVersion);
Console.WriteLine("state:(0)", connection.State);

Oracle.DataAccess.Client.OracleDataAdapter oraadapter = new Oracle.DataAccess.Client.OracleDataAdapter(qstring, connection);

DataSet ds = new System.Data.DataSet();

Oracle.DataAccess.Client.OracleCommand updcmd;
updcmd = new Oracle.DataAccess.Client.OracleCommand("UPDATE application SET APP_TYPE='" + TextBox2.Text + "', SOLN_NAME='" + TextBox3.Text + "',FUN_NAME='" + TextBox4.Text + "',PAR_COUNT='" + TextBox5.Text + "',CLASS_NAME='" + TextBox6.Text + "',EXECUTE_TYPE='" + TextBox7.Text + "',REMARKS='" + TextBox8.Text + "' WHERE APP_NAME='" + TextBox1.Text + "'", connection);

updcmd.ExecuteNonQuery();
}
}
catch (Oracle.DataAccess.Client.OracleException ex)
{
Console.WriteLine("error" + ex.Message);
Label1.Text = "not success";
}
finally
{
connection.Close();
Label1.Text = "successfully Updated";
Console.WriteLine("connection closed");
}

}

}


Reference: http://naveenkumarm.page.tl


Comments

Author: Ahmad Nauman27 Apr 2010 Member Level: Bronze   Points : 2

The way how you tried to explain some posts at here seems to me different...there are certainly different posts at here,but I didnt find any post related to projects like 642-181...if someone have information about it,do tell me!Well any updates related to this post?if yes than do tell me!Is there anyone having information about 642-067 exam?








Author: Er. Ram Singh01 Sep 2010 Member Level: Gold   Points : 2

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 System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
string connstring = "Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = " + "inca81" + " )(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = " + "tm" + "))); User Id =" + "test" + "; Password = " + "test" + ";";

string qstring;
qstring = "select * from APPLICATION";
Oracle.DataAccess.Client.OracleConnection connection = new Oracle.DataAccess.Client.OracleConnection(connstring);

try
{
connection.Open();
{
Console.WriteLine("connection opened");
Console.WriteLine("connection properties");
Console.WriteLine("connectionstring:(0)", connection.ConnectionString);
Console.WriteLine("server version :(0)", connection.ServerVersion);
Console.WriteLine("state:(0)", connection.State);

Oracle.DataAccess.Client.OracleDataAdapter oraadapter = new Oracle.DataAccess.Client.OracleDataAdapter(qstring, connection);

DataSet ds = new System.Data.DataSet();

Oracle.DataAccess.Client.OracleCommand updcmd;
updcmd = new Oracle.DataAccess.Client.OracleCommand("UPDATE application SET APP_TYPE='" + TextBox2.Text + "', SOLN_NAME='" + TextBox3.Text + "',FUN_NAME='" + TextBox4.Text + "',PAR_COUNT='" + TextBox5.Text + "',CLASS_NAME='" + TextBox6.Text + "',EXECUTE_TYPE='" + TextBox7.Text + "',REMARKS='" + TextBox8.Text + "' WHERE APP_NAME='" + TextBox1.Text + "'", connection);

updcmd.ExecuteNonQuery();
}
}
catch (Oracle.DataAccess.Client.OracleException ex)
{
Console.WriteLine("error" + ex.Message);
Label1.Text = "not success";
}
finally
{
connection.Close();
Label1.Text = "successfully Updated";
Console.WriteLine("connection closed");
}

}

}



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: