|
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...
|
|
|
|
|
|
http://atomnet.sourceforge.net/example.html#proxy
|
|
|
|
|
|
hiii
i tried to install SQL Server 2000 on my Windows 2000 Advanced Server and i got error when the setup was configuring the server... it told to check the sqlstp.log file which has the following lines at the end...
i could not get the error...
can anyone help me ???
thnkx
*************************************************************
00:20:03 End Action: Locked Connectivity Files Check
00:20:03 Setup is installing Microsoft Data Access Components (MDAC) ...
00:20:03 G:\x86\Other\sqlredis.exe /q:a /C:"setupre.exe WARN=1 -s -SMS"
00:20:35 ExitCode: 0
00:20:35 Setup is installing Microsoft Distributed Transaction Coordinator (MSDTC) ...
00:20:35 D:\WINNT\TEMP\SqlSetup\Bin\cldtcstp.exe -SupportDir "D:\WINNT\TEMP\SqlSetup\Bin" -DTCPkg "G:\x86\Other\dtcsetup.exe" -LogFile "D:\WINNT\sqlstp.log"
00:20:35 Process Exit Code: (0)
00:20:35 InstallMSSearch instance: MSSQLSERVER
00:20:35 Software\Microsoft\Search\Install:Version not present
00:20:35 MSSearch 2.0 or greater version check returned -1
00:20:35 Setup is installing the Microsoft Full-Text Search Engine ...
00:20:35 "G:\x86\FullText\MSSearch\Search\SearchStp.exe" /s /a:SQLServer
00:20:44 Process Exit Code: (0)
00:20:44 /Q:A /T :\WINNT\TEMP\ixp001.tmp
00:20:44 Setup is installing HTML Help ...
00:20:45 HTML Help installer exit code: 0
00:21:07 End Action InstallPkgs
00:21:07 Begin Action MoveFileData:
00:21:07 Enabled SELFREGISTERBATCH
00:21:07 Enabled CORECOMPONENTHANDLING
00:22:07 Begin Action: MoveFileDataSpecial
00:22:07 End Action: MoveFileDataSpecial
00:22:07 End Action MoveFileData
00:22:07 Begin Action ProcessAfterDataMove:
00:22:07 G:\x86\Binn\hhcol.exe D:\Program Files\Microsoft SQL Server\80\Tools\Books
00:22:08 End Action ProcessAfterDataMove
00:22:08 Begin Action BuildServer:
00:22:08 D:\WINNT\TEMP\SqlSetup\Bin\scm.exe -Silent 1 -Action 5 -ExePath "D:\Program Files\Microsoft SQL Server\MSSQL\binn\sqlservr.exe" -Service "MSSQLSERVER"
00:22:08 Process Exit Code: (0)
00:22:08 Begin Action: CreateRegistrySetSQL
00:22:08 End Action: CreateRegistrySetSQL
00:22:08 Begin Action: RegWriteSetupEntry
00:22:08 End Action: RegWriteSetupEntry
00:22:09 Begin Action: CreateSer
00:22:09 End Action: CreateSer
00:22:09 Begin Action: SkuIt
00:22:09 End Action: SkuIt
00:22:09 SetFileSecuritySQLAndAdmin for D:\Program Files\Microsoft SQL Server\MSSQL returned: 1350, 1350
00:22:09 SetRegSecuritySQLAndAdmin for Software\Microsoft\MSSQLServer\MSSQLServer returned: 0, 0
00:22:09 Begin Action: UpdateSystemPath
00:22:09 Path successfully updated.
00:22:09 %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\Program Files\Microsoft SQL Server\80\Tools\BINN
00:22:09 End Action: UpdateSystemPath
00:22:09 Grant Right for V2RS\Administrator returned : 1, 0
00:22:09 Grant Right for V2RS\Administrator returned : 1, 0
00:22:09 Grant Right for V2RS\Administrator returned : 1, 0
00:22:09 Grant Right for V2RS\Administrator returned : 1, 0
00:22:10 D:\Program Files\Microsoft SQL Server\80\Tools\Binn\cnfgsvr.exe -F "D:\WINNT\sqlstp.log" -I MSSQLSERVER -V 1 -M 0 -Q "SQL_Latin1_General_CP1_CI_AS" -H 524698 -U sa -P
###############################################################################
Starting Service ...
SQL_Latin1_General_CP1_CI_AS
-m -Q -T4022 -T3659
Connecting to Server ...
driver={sql server};server=VISHUCOOL;UID=sa;PWD=;database=master
[Microsoft][ODBC SQL Server Driver][Named Pipes]Connection broken.
[Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionRead (GetOverLappedResult()).
driver={sql server};server=VISHUCOOL;UID=sa;PWD=;database=master
[Microsoft][ODBC SQL Server Driver][Named Pipes]Connection broken.
[Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionRead (ReadFile()).
driver={sql server};server=VISHUCOOL;UID=sa;PWD=;database=master
[Microsoft][ODBC SQL Server Driver][Named Pipes]Connection broken.
[Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionRead (ReadFile()).
SQL Server configuration failed.
|
|
|
|
|
This is the Wrong forum to post this in.
Maybe you should try here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_rptconsetup_2awg.asp
|
|
|
|
|
Your question has nothing to do with VB.NET. You might want to try posting this in the SQL Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear Friend,
I have problem in my ritchtext box syntax.
when i reach to the syntax
RichTextBox.SelPrint Printer.hDC
it says object required. Error no 424
your quick response will be appriciated
Thanks
Murtuza Patel.
|
|
|
|
|
It would seem that your Printer object has been defined, but not instantiated. Are you missing a "New" somewhere? We can't tell you anything definitive because you didn't post any code defining and setting up the objects in question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
There are 4 threads each of which downloads data from the internet and displays it in a datagrid.
Thread.start() starts each of these threads.
The problem is they all start off at the same time, filling the same grid without waiting for the previous thread to finish its task.
The result is that the search results fetched by the last thread only get displayed.
A solution is to use Thread.Join() method which forces a succeeding thread to wait for the preceding one to finish its task.
But the Join method locks the GUI and hence we cant click on Cancel or Stop button(similar to that of Internet explorer) to stop the thread and the corresponding download.
If thread.join(1000) which makes the succeedig thread wait for 1000 mili seconds, is used, then few or no results are displayed since the time to finish the task may exceed this time limit.
Need a solution asap.
Would be gr8 if some1 cud help.
Genius123
|
|
|
|
|
Probably Im not taking your point but if you want that each thread waits for the previous one to be finished before doing anything you could just make all 4 tasks in one thread one after the other...
|
|
|
|
|
If each thread is waiting for the previous one, what's the point of having all these threads? Your app is now executing asyc anyway...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The problem was with Thread.Join method which locks the GUI.
So you cant click on any other control that tries to stop the thread execution.
But I got the soln. The soln lies in using a mutex object which makes the succeeding thread wait for the preceding thread without locking the GUI.So simultaneously, other controls on the UI can be clicked.
The basic idea is downloading data from the internet using threads and yet being able to use the stop button to stop the search.
|
|
|
|
|
i'm writing this code to be used on a PDA, what i want is to just create a Word document, write some things in and close it. But when i try opening it, an error appears saying that the file cant be opened.
Dim fs As New FileStream("newfile.doc", FileMode.Create, FileAccess.Write, FileShare.None)
Dim sm As New StreamWriter(fs)
Dim i As Integer
Dim j As Integer
sm.WriteLine("test")
sm.Close()
what did i do wrong?
|
|
|
|
|
pocket word won't recognize a ".doc"
(they are: .psw,.psw and ect...)
the format of a pocket word document is actually "rich text format"
so create your file as a .TXT or .RTF
The pocket office apps have no exposed API or automation.
Pocket Word also does not support headers, footers, footnotes, captions, indexes or comments
|
|
|
|
|
i found the problem, i forgot to close the filestream object which i set permissions on. thanks for the reply anyway.
|
|
|
|
|
This is my first app i have ever written. Im almost done. I just need to know how to open my help file within my application. I have written the help file using HelpNDOC i have added it to my project but i cant figure out how to open it. I dont care about context numbers or anything. I just want the help file to open when the user selects "Help" very simple tho i cant figure it out.
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformshelpclassshowhelptopic.asp?frame=true
|
|
|
|
|
|
How do you, after retrieving a row from an access DB, take each column and display it on the screen? I've tried using the .Fill method as follows
Me.oledb_adapMember1.Fill(Me.DsMember1.Member_Table)
without any success. It always grabs the first row and displays it and not the one I just retrieved. My retrieve statement looks like this:
Dim FoundRow() As DataRow
dblMemberNum = Convert.ToDouble(Me.txtMbrNumber.Text)
FoundRow = DsMember1.Tables("Member Table").Select("NO_Member='" & dblMemberNum & "'")
Thanks for any help you can give.
Thanks,
T
|
|
|
|
|
How can I get the ValueMember of a CheckedListBox object if I know the DisplayMember?
this is how I load the CheckedListBox :
ComboBox1.DisplayMember = "FirstNames"
ComboBox1.ValueMember = "id"
ComboBox1.DataSource = objDS.Tables("table2")
now I need to get the valueMember of a displayMember(ex displayMember = "John").
Thanks,
Martin
|
|
|
|
|
You need to bind the SelectedValue property to the id field also. Then you get the value by:
memId = ComboBox1.SelectedValue
|
|
|
|
|
Cant figure out how to make the report load from the records in my listview.
Or i cant figure out how to limit what is displayed in a report.
Like i have a member ID and i have a button thats filters my list view to only show records with that member ID. But the report shows all records for all member ID's.
I am using a VB.NET and SQL database. PLEASE HELP ME!!!!!
-Joey
Joey
|
|
|
|
|
Hi,
Filter records as per member Id using a selection formula in your source code.
if u r using a crytal report viewer control it wud be as:
Crviewer1.selectionformula = "<report field name for MemberId> =" & memberid (where memberid may be procured from a text box or someother control)
genius
|
|
|
|
|
I appreciate the answer. I had already figured it out. I used a parameter field instead.
It better suits my program for the user to be prompted for a memberID. Hey if you get a
chance read my newer post.
|
|
|
|