Click here to Skip to main content
15,914,165 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to work with Medical equipments can anybody help Pin
Anonymous24-Apr-05 12:57
Anonymous24-Apr-05 12:57 
GeneralRe: How to work with Medical equipments can anybody help Pin
progload24-Apr-05 13:02
progload24-Apr-05 13:02 
GeneralRe: How to work with Medical equipments can anybody help Pin
monica2k24-Apr-05 13:06
monica2k24-Apr-05 13:06 
GeneralRe: How to work with Medical equipments can anybody help Pin
progload24-Apr-05 13:13
progload24-Apr-05 13:13 
GeneralRe: How to work with Medical equipments can anybody help Pin
progload24-Apr-05 13:18
progload24-Apr-05 13:18 
GeneralRe: How to work with Medical equipments can anybody help Pin
progload24-Apr-05 13:24
progload24-Apr-05 13:24 
GeneralRe: How to work with Medical equipments can anybody help Pin
monica2k24-Apr-05 13:36
monica2k24-Apr-05 13:36 
QuestionHow to convert dynamically convert a dataset to a defined dataset Pin
David M J23-Apr-05 13:06
David M J23-Apr-05 13:06 
Hi,
not sure if the subject is really clear but anyway, what I am trying to do is to create a generic data adapter for the different datasets I am using, I don't like all the code .net crestes to add the parameters to the data adapter. In order to do this I read the necessary columns from the tables in the datasets as I or .net defined them on design time. In my procedures I change the columns of my datatables, so in order to creaste the update command parameters I need to get back to the original dataset. As I don't know how to get the original settings out of the current dataset I decided to Dim a new dataset, just for the sstructure, which is the same Type as the current dataset. This works OK if I know at design time what kind of dataset I need to expect, but then durign development you need to go back and update some kind of Select case statement every time you add a new dataset to your project. I have been trying with Ctype and gettype statements but I do not succeed. Guess it is straight forward and I am just missing at least one thing.

Any suggestions?

Public Sub dsAction(ByVal dsOrig As DataSet)
' Dim Audit1 As clAudit
Dim strSQL As String
Dim tb As DataTable
Dim cl As DataColumn
Dim intCount As Integer
Dim strSQLUpd As String
Dim strSQLUpdWhere As String
Dim strSQLIns As String
Dim strSQLInsVal As String
'Dim strSQLDel As String
Dim Newdataset As New dataset
Dim ts As Type
'Audit1 = New clAudit

!! THIS line does not work
dataset = CType(Newdataset,gettype(dsorig.gettype.fullname))



Try
'Open the connection.
'Me.OleGenCon.Open()
For Each tb In Newdataset.Tables
Dim OleDaA As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
Dim OleDUpdA As OleDb.OleDbCommand = New OleDb.OleDbCommand
Dim OleDInsA As OleDb.OleDbCommand = New OleDb.OleDbCommand

strSQLIns = "INSERT INTO " & tb.TableName & "("
strSQLUpd = "UPDATE " & tb.TableName & " SET "
'strSQLDel = "DELETE FROM " & tb.TableName & " WHERE (GEN_ID = ?)"
For Each cl In tb.Columns
OleDaA.TableMappings(0).ColumnMappings.Add(cl.ColumnName, cl.ColumnName)
If Not cl.ColumnName = "TABLE_ID" Then
If intCount > 0 Then
strSQLIns = strSQLIns & ", "
strSQLUpd = strSQLUpd & ", "
End If


Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
GeneralATOM Pin
rstat123-Apr-05 11:13
rstat123-Apr-05 11:13 
GeneralRe: ATOM Pin
progload23-Apr-05 13:57
progload23-Apr-05 13:57 
GeneralRe: ATOM Pin
rstat123-Apr-05 13:59
rstat123-Apr-05 13:59 
GeneralProb installing MSSQL Server 2000 Pin
Anonymous23-Apr-05 7:24
Anonymous23-Apr-05 7:24 
GeneralRe: Prob installing MSSQL Server 2000 Pin
Anonymous23-Apr-05 10:20
Anonymous23-Apr-05 10:20 
GeneralRe: Prob installing MSSQL Server 2000 Pin
Dave Kreskowiak23-Apr-05 16:08
mveDave Kreskowiak23-Apr-05 16:08 
GeneralRitchTextBox SelPrint Problem Pin
Murtuza Husain Miyan Patel23-Apr-05 4:35
professionalMurtuza Husain Miyan Patel23-Apr-05 4:35 
GeneralRe: RitchTextBox SelPrint Problem Pin
Dave Kreskowiak23-Apr-05 16:06
mveDave Kreskowiak23-Apr-05 16:06 
GeneralMultithreading problem Pin
genius12323-Apr-05 0:35
genius12323-Apr-05 0:35 
GeneralRe: Multithreading problem Pin
Robert Rohde23-Apr-05 7:57
Robert Rohde23-Apr-05 7:57 
GeneralRe: Multithreading problem Pin
Dave Kreskowiak23-Apr-05 16:02
mveDave Kreskowiak23-Apr-05 16:02 
GeneralRe: Multithreading problem Pin
genius12324-Apr-05 22:50
genius12324-Apr-05 22:50 
GeneralHelp with creating a Word File using .net Pin
gundamhamtaro22-Apr-05 15:21
gundamhamtaro22-Apr-05 15:21 
GeneralRe: Help with creating a Word File using .net Pin
Anonymous23-Apr-05 9:54
Anonymous23-Apr-05 9:54 
GeneralRe: Help with creating a Word File using .net Pin
gundamhamtaro23-Apr-05 14:58
gundamhamtaro23-Apr-05 14:58 
QuestionHow do i open a help file in my App. Pin
Joey Picerno22-Apr-05 13:43
Joey Picerno22-Apr-05 13:43 
AnswerRe: How do i open a help file in my App. Pin
progload23-Apr-05 14:15
progload23-Apr-05 14:15 

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.