Knowledge Share
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Knowledge Share

Knowledge is NOT Power IMPLEMENTATION of knowledge is Power!!!
 
HomePortalGalleryLatest imagesRegisterLog in

 

 Database Connection

Go down 
AuthorMessage
Admin
Admin



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

Database Connection Empty
PostSubject: Database Connection   Database Connection Icon_minitimeMon 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
https://knowledgeshare.forumotion.com
 
Database Connection
Back to top 
Page 1 of 1
 Similar topics
-
» Database Faqs
» To Modify An existing Record in DataBase
» To Find An existing Record in DataBase and display in fields

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