what is the syntax code for oldb to connect oracle

Answers were Sorted based on User's Feedback



what is the syntax code for oldb to connect oracle..

Answer / srinivas.kinthada

i think oldb is not correct it's may b.
it is oledb

using system.data.oledb;
oledbconnection cn=new
oledbconnection("uid=<username>;pwd=<password>;server=<servername>");
cn.open();

Is This Answer Correct ?    2 Yes 0 No

what is the syntax code for oldb to connect oracle..

Answer / raghavendra.v

it is not oldb it may be oledb

using System.Data.Oledb;

Oledbconnection cn=new OleDbConnection
("Provider=Msdaora.1;uid=<username>;pwd=<pwd>;server=<server
name>");
cn.open();

Is This Answer Correct ?    1 Yes 1 No

what is the syntax code for oldb to connect oracle..

Answer / sudha

first add the namespace

using system.Data.oledb;

OledbConnection cntn = new OledbConnection("Provider =
Microsoft.jet.oledb.12.0;datasource = (local);Integrated
security = SSPI,persistent Security = false");

provider = it depends on version of Microsoft Access like if
it is 2003 - 4.0 & if it is 2007 - 12.0

dataource - u can make it as local or provide the path to ur
database

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

How can we load multiple tables in to dataset?

0 Answers  


How to get the new oledb connection of oracle in database programming?

1 Answers  


How to connect and retrieve data from database using dataset

0 Answers  


What is a dataset?

3 Answers  


What is the use of ADO.NET and XML web services?

0 Answers   TCS,






What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

0 Answers  


What is different between sqlcommand object and command behavior object?

0 Answers  


once data is fetched into dataset connection gets closed. but in datareader connection is always maintained...then why datareader is fast and mainly recommended ?

2 Answers  


What is the use of connection object in ado.net?

0 Answers   TryTechnicals Pvt Ltd,


What is difference between executenonquery and executequery?

0 Answers  


What is connected architecture in ado.net?

0 Answers  


How To Update A Column In A DataGrid Using C#.NET? I am getting InvalidCastException as (Specified cast is not valid) while updating 2nd column in a datagrid? Id,firstname,lastname are the three columns of my datagrid respectively. I wanted to edit the second column(lastname) and update it. I did the following code in DataGrid's updatecommand(),but failed to update ! Int varid=(int)DataGrid1.DataKeys[e.Item.ItemIndex]; TextBox lnm=(TextBox)e.Item.Cells[2].Controls[0]; string str=lnm.Text ; SqlCommand cmd=new SqlCommand("update customer set lastname='" + str + "' where id=" + varid + "",con); cmd.ExecuteNonQuery(); DataGrid1.EditItemIndex=- 1; DataGrid1.DataBind();

2 Answers   Mind Tree, TCS,


Categories