Click here to Skip to main content
15,903,175 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Chaning button with an image Pin
Member 225908026-Sep-05 12:13
Member 225908026-Sep-05 12:13 
QuestionMusic with VB.NET Pin
Anonymous25-Sep-05 23:52
Anonymous25-Sep-05 23:52 
AnswerRe: Music with VB.NET Pin
Gopi.V26-Sep-05 1:36
Gopi.V26-Sep-05 1:36 
Questionis it possible.... Pin
icowa25-Sep-05 22:04
icowa25-Sep-05 22:04 
AnswerRe: is it possible.... Pin
rwestgraham26-Sep-05 8:01
rwestgraham26-Sep-05 8:01 
GeneralRe: is it possible.... Pin
icowa26-Sep-05 12:45
icowa26-Sep-05 12:45 
QuestionHow to use class for data accessing Pin
akhil.garg25-Sep-05 21:20
akhil.garg25-Sep-05 21:20 
AnswerRe: How to use class for data accessing Pin
Gopi.V26-Sep-05 1:42
Gopi.V26-Sep-05 1:42 
use this function for retrival

Public Function FetchData(ByVal tableName As String, Optional ByVal sql As String = "", Optional ByVal Transaction As OleDb.OleDbTransaction = Nothing, Optional ByVal mAddWithKey As Boolean = True) As DataTable
Dim tblData As DataTable
If sql = "" Then
DADPTable = New OleDb.OleDbDataAdapter("Select * from " & tableName, DataConnection)
Else
DADPTable = New OleDb.OleDbDataAdapter(sql, DataConnection)
End If
If Not Transaction Is Nothing Then
DADPTable.SelectCommand.Transaction = Transaction
End If
DADPTable.AcceptChangesDuringFill = True
If mAddWithKey Then DADPTable.MissingSchemaAction = MissingSchemaAction.AddWithKey
tblData = New DataTable(tableName)
DADPTable.Fill(tblData)
FetchData = tblData
tblData = Nothing
End Function

Use this function for update :

Public Sub UpdateData(ByVal tableName As DataTable, Optional ByVal Transaction As OleDb.OleDbTransaction = Nothing)
Dim commandBuild As OleDb.OleDbCommandBuilder
DADPTable = New OleDb.OleDbDataAdapter("Select Top 1 * from " & tableName, DataConnection)
If Not Transaction Is Nothing Then DADPTable.SelectCommand.Transaction = Transaction
Dim tblAdd As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Added)
Dim tblModify As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Modified)
Dim tblDelete As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Deleted)

If Not tblAdd Is Nothing Then
If tblAdd.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.InsertCommand = commandBuild.GetInsertCommand()
If Not Transaction Is Nothing Then DADPTable.InsertCommand.Transaction = Transaction
DADPTable.Update(tblAdd)
End If
End If
If Not tblModify Is Nothing Then
If tblModify.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.UpdateCommand = commandBuild.GetUpdateCommand()
If Not Transaction Is Nothing Then DADPTable.UpdateCommand.Transaction = Transaction
DADPTable.Update(tblModify)
End If
End If
If Not tblDelete Is Nothing Then
If tblDelete.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.DeleteCommand = commandBuild.GetDeleteCommand()
If Not Transaction Is Nothing Then DADPTable.DeleteCommand.Transaction = Transaction
DADPTable.Update(tblDelete)
End If
End If
DADPTable = Nothing
commandBuild = Nothing
End Sub

V.Gopi.
Easy Design Systems
Coimbatore
India
Questionhow to save pdf files to SQL database? Pin
BORN...again!25-Sep-05 20:42
BORN...again!25-Sep-05 20:42 
QuestionHelp files Pin
JD_SA25-Sep-05 20:24
sussJD_SA25-Sep-05 20:24 
AnswerRe: Help files Pin
Briga25-Sep-05 21:36
Briga25-Sep-05 21:36 
Question.NET Themes Pin
Chetan Ranpariya25-Sep-05 18:56
Chetan Ranpariya25-Sep-05 18:56 
QuestionRe: Application Security Pin
Anonymous25-Sep-05 18:42
Anonymous25-Sep-05 18:42 
AnswerRe: Application Security Pin
Dave Kreskowiak26-Sep-05 1:36
mveDave Kreskowiak26-Sep-05 1:36 
QuestionHow i shutdown another PC in the network Pin
basant_kpg25-Sep-05 18:05
basant_kpg25-Sep-05 18:05 
AnswerRe: How i shutdown another PC in the network Pin
Steve Pullan25-Sep-05 20:52
Steve Pullan25-Sep-05 20:52 
QuestionRe: How i shutdown another PC in the network Pin
basant_kpg26-Sep-05 4:29
basant_kpg26-Sep-05 4:29 
AnswerRe: How i shutdown another PC in the network Pin
Steve Pullan26-Sep-05 13:51
Steve Pullan26-Sep-05 13:51 
QuestionWhats <% .. %> Pin
haruka_emi25-Sep-05 17:52
haruka_emi25-Sep-05 17:52 
AnswerRe: Whats <% .. %> Pin
Alsvha25-Sep-05 20:20
Alsvha25-Sep-05 20:20 
QuestionBar Codes EAN13 Pin
makeko25-Sep-05 16:11
makeko25-Sep-05 16:11 
AnswerRe: Bar Codes EAN13 Pin
Dave Kreskowiak25-Sep-05 16:42
mveDave Kreskowiak25-Sep-05 16:42 
QuestionInteraction with OS buffer Pin
Member 109769925-Sep-05 15:42
Member 109769925-Sep-05 15:42 
AnswerRe: Interaction with OS buffer Pin
Steve Pullan25-Sep-05 16:12
Steve Pullan25-Sep-05 16:12 
AnswerRe: Interaction with OS buffer Pin
Dave Kreskowiak25-Sep-05 16:40
mveDave Kreskowiak25-Sep-05 16:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.