In Web forms, i have my connection string in web.config
and this is how I use it if I want to access the data
1.) What I need is how I can use this style in VB.net. wherein there is a public connection string I'll just have to access.
2.) How can I use this if I want this to fill my datagrid without using datasets & adapters.
please help.
HTML:
<add name="Oraconn"connectionString="Data Source=testdb;User ID=test;Password=test;Unicode=True"
providerName="System.Data.OracleClient" />
and this is how I use it if I want to access the data
VB.NET:
Dim OraCON As New OracleConnection(ConfigurationManager.ConnectionStrings("Oraconn").ConnectionString)
Dim CHKcmd As New OracleCommand("SELECT * FROM TEST_TBL", OraCON)
OraCON.Open()
Dim CHKval As OracleDataReader = CHKcmd.ExecuteReader()
If CHKval.Read Then
textbox1.text = chkval("test_field")
end if
2.) How can I use this if I want this to fill my datagrid without using datasets & adapters.
please help.
Last edited by a moderator: