How do you connect to SQL Server Database without using sqlclient ?

 Posted by Bharathi Cherukuri on 5/21/2012 | Category: ADO.NET Interview questions | Views: 2275 | Points: 40
Answer:

You can connect to SQL Server Database without using sqlclient by using oledb namespace.

Example:

<%@ Import Namespace="System.Data.OleDb" %>


<script runat="server">
sub Page_Load
dim dbconn
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("northwind.mdb"))
dbconn.Open()
end sub
</script>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response