Knowledge Share

Knowledge is NOT Power IMPLEMENTATION of knowledge is Power!!!
 
HomePortalGalleryCalendarFAQRegisterUsergroupsLog in

Share | 
 

 Database Connection

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin


Posts : 142
Points : 410
Reputation : 0
Join date : 2007-12-29
Location : Chennai

PostSubject: Database Connection   Mon Feb 08, 2010 11:14 am

In Global.asax file

In Genaral
Imports System.Data.OleDb
Imports System.Web

In Application Start

Dim CON As OleDbConnection
Application("CON") = New OleDbConnection("PROVIDER=MSDAORA.1;USER ID=SCOTT;PASSWORD=TIGER")

To Add A new Record to DataBase

1st Method

Dim adp1 As OleDbDataAdapter
Dim ds1 As New DataSet()
Dim dt1 As DataTable
con = Application("con")
adp1 = New OleDbDataAdapter("select * from notice", con)
adp1.Fill(ds1, "notice")
dt1 = ds1.Tables("notice")
Dim cmb As OleDbCommandBuilder = New OleDbCommandBuilder(adp1)
Dim dr As DataRow
dr = dt1.NewRow()
dr("Noticeno") = TextBox2.Text
dr("noticedate") = DateTime.Now
dr("notice") = ta.Value
dr("Branchcode") = dl.SelectedItem
dt1.Rows.Add(dr)
adp1.Update(ds1, "notice")
adp1.Fill(ds1)
Response.Write("Operation Compleated Successfully")
Back to top Go down
http://knowledgeshare.forumotion.com
 
Database Connection
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» selenium with database testing
» Could not start Selenium session: Connection timed out: connect
» The connection has timed out
» How can i store all the commandsused by rc in a database??
» Gang Tag Database

Permissions in this forum:You cannot reply to topics in this forum
Knowledge Share :: .Net-
Jump to: