|
I have an access Table with vendor_num and vendor_name fields.
I have an oracle Table which has a vendor_num field and other fields of details.
Initially, my thought was to pull the access table into a dataset and then pull the oracle table into the dataset, form a datarelation between the two, and use GetChildRows to pull the other details from the oracle table I pulled in.
however...
When I tried to do this I got an error b/c not all data in the child table (oracle table) had a parent...
Can someone point me in the right direction into either fixing this train of thought or a new method altogether, please?
Thanks
Cavall
Dim conn As New OdbcConnection("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Documents and Settings\mwaters2\My Documents\VQM\testVQM.mdb;Uid=Admin;Pwd=;")
Dim da As New OdbcDataAdapter("SELECT Vendor_Num FROM Top50_test", conn)
Dim ds As New DataSet
da.Fill(ds, "Top50")
DataGrid1.DataSource = ds.Tables("Top50")
DataGrid1.DataBind()
Dim conn2 As New OleDbConnection("Provider=msdaora;Data Source=VQM;User Id=***;Password=***;")
Dim childSQL As String
childSQL = "" & _
"SELECT vendor.vendor_num, restratificationhistory.vend_accy " & _
"FROM vendor, restratificationhistory " & _
"WHERE vendor.vendor_num = restratificationhistory.vendor_num " & _
"AND restratificationhistory.dt_tm_added Between to_date('1/1/04','MM/DD/YY') AND to_date('11/10/04','MM/DD/YY')"
Dim da2 As New OleDbDataAdapter(childSQL, conn2)
da2.Fill(ds, "Details")
Dim parentCol As DataColumn = ds.Tables("Top50").Columns("Vendor_Num")
Dim childCol As DataColumn = ds.Tables("Details").Columns("Vendor_Num")
Dim dr As New DataRelation("VendorToDetails", parentCol, childCol)
ds.Relations.Add(dr)
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
--------------------------------------------------------------------------------
hi guys! i am creating a report, but the values will be coming from 3 tables. when i call this code: OleAdpReport.fill(DSReport, "Table1"), it gives me an error. I believe this is because I have 3 source tables that are joined. i also cleared the links that bind them during the configuration of the report. what shall i do?
|
|
|
|
|
how to create a login form to submit another form?
please tell me about the source code above. thanks.
|
|
|
|
|
Try to check the information from here.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
vb.net
How can load a Image in to a TabControl.
normally we can load the Image through property. It's Ok.
The Image is not covered the whole part of the tabControl.
Tabbutton always gray.
How can put a Image on the top of the tabcontrol.
Help Me
|
|
|
|
|
i'm not sure that i understand your question, and i got a pretty 'Go-Around' solution for the question i *think* you have asked.
you can load and display any image on any object, using BitBlt.
read this article i wrote
http://www.codeproject.com/vb/net/Bitblt_wrapper_class.asp[^]
you can load a bitmap and use this class to show it over the tabcontrol.
or you can think about it and probably find a better way to do it
Fade (Amit BS)
|
|
|
|
|
Hi There,
Who can help me with this one.
I need to import data from a Data Interchange file (*.DIF) to a Dataset or Datareader
I was thinking to do that with a deserialization but I can not define the Dif format.
Any Idea how to solve this ?
Here an example how I load data from a binary file to a hashtable
Dim ConfigFile As New FileInfo(GetTypePath())
If ConfigFile.Exists Then
Dim bfConfig As New Formatters.Binary.BinaryFormatter
Dim fsConfig As New FileStream(Me.GetTypePath(), _
FileMode.Open, _
FileAccess.Read)
Me.oDataStore = CType(bfConfig.Deserialize(fsConfig), Hashtable)
fsConfig.Close()
Return True
End If
I was thinking to replace the Hashtable with System.Windows.Forms.DataFormats.Dif
But that is not working. May be I need todo this with Direct Cast but I do not know how to that
Any help or info is welcome
Thanks
|
|
|
|
|
I have a problem with VB.Net 2003, ever since upgrading Windows XP sp 2.
Msgbox now does not show anything in the text or the buttons. The same exe works correctly on a Windows 2003 server, but not on another machine that runs sp 2.
This must be a known problem, what do I do to fix it.
Please help
|
|
|
|
|
The first thing I'd do is update the drivers for your video card.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Already done. This is also happening on at least one other PC with sp2. Mine is an HP the other is a Dell.
|
|
|
|
|
How can i show sort icon (Arrows) in the column header of the listview in vb.net can any body help me....
Ravi
|
|
|
|
|
Hi,
I have developed a VB application. That simply have two Database, One source database is MS Access and destination database is SQL Server. Through this application it will import data from source db (Access) to destination db (SQL Server). when running application it works efficiently bout if yo see its status in windows task manager it display as "Not Responding", while it import all data successfully.
Does anyone find its solution?
Thanks
Amit Chowdhury
|
|
|
|
|
This is because your application is not yielding every once in a while so it's message pump can execute. Inside the loop that is processing your records, include a Application.DoEvents() statement.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Do anyone know how can i make use of TAPI in VB.NET for developing Telephony Applications like Answering Machine.Thank U
|
|
|
|
|
The TAPI 3.0 wrapper has "issues" to say the least. Your best bet is to use TAPI 2.0 instead. There is a wrapper class available on GotDotNet, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I would like to know how to share a folder which is on the C drive of a PC which is on a network.
I have 2 computers hooked on to the server.
On the first machine (C DRIVE) I have created a folder and set its property to sharing.
From the second PC I want to access only that folder of the first PC.
The Server is on Win2003 and the workstations are on win2K
I have Administrative rights too.
can some one help
Tnx
|
|
|
|
|
Your question has nothing to do with VB.NET. Post it in the Operating SYstems/SysAdmin Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You should post this question to the Operating System forum, but anyway I still answer your question.
Paps2 wrote:
From the second PC I want to access only that folder of the first PC.
In case if you are using client/server with DHCP server, you must know the computer name and share name of your folder. If you the first PC name pc1 and the share folder name is test then on the second PC go to Start menu -> Run and type \\pc1\test and press enter.
In case if you are using static IP address of each machine, you must know the computer name or an IP address of the destination machine. If you the first PC name pc1 with IP address 192.168.1.10 and the share folder name is test then on the second PC go to Start menu -> Run and type \\pc1\test or \\192.168.1.10\test and press enter. But make sure that you have the following options:
1. Client: Client for Microsoft Network.
2. Service: File and Print sharing for Microsoft Network service.
3. Protocol: TCP/IP protocol.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Thanks a bunch. Apreciate your prompt reply.
Sorry for my stupidity in putting the question here in this forum. Next time I will put them in approprite forums.
Tnx
Paps
|
|
|
|
|
I would appreciate it if some one could help me. I don't know how to write the code to save or save as in my forms. Here is the code that I have so far. Note that my parent form has file(new,open, save, save as, close) on it. I have already done the new code and I have been searching through the help files of .Net for 2 hours now with no help what so ever. Also please note that opion strict is set to on.
Public Class frmMDI
Inherits System.Windows.Forms.Form
Dim counter As Integer = 1
Private Sub frmMDI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Dim j As Integer
'For j = 1 To 3
' Dim frmDocForm As New frmChild
' frmDocForm.MdiParent = Me
' frmDocForm.Show()
'Next
End Sub
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
If e.Button.Tag Is "new" Then
NewFile()
ElseIf e.Button.Tag Is "open" Then
ElseIf e.Button.Tag Is "save" Then
ElseIf e.Button.Tag Is "bold" Then
Dim frmActiveChild As frmChild = Me.ActiveMdiChild
If (Not frmActiveChild Is Nothing) Then
'process the child form – save, close, whatever
frmActiveChild.txtDoc.Font = New Font(Me.Font, FontStyle.Bold)
End If
End If
End Sub
#Region "Menu Code"
#Region "Window Code"
Private Sub mnuCascade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCascade.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub mnuHorizontal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHorizontal.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub mnuVertical_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuVertical.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
#End Region
#Region "File Code"
Private Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuNew.Click
NewFile()
End Sub
Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
End Sub
<b> Private Sub mnuSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSave.Click
End Sub
Private Sub mnuSaveAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSaveAs.Click
End Sub</b>
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
End Sub
#End Region
#End Region
#Region "Procedures"
Private Sub NewFile()
Dim frmDocForm As New frmChild
frmDocForm.MdiParent = Me
frmDocForm.isDirty = False
frmDocForm.newDoc = True
frmDocForm.docName = "Document" & CStr(counter)
counter += 1
frmDocForm.Text = frmDocForm.docName
frmDocForm.Show()
End Sub
#End Region
this is the code in my child form.
Public Class frmChild
Inherits System.Windows.Forms.Form
'---------------------------------------------------
'Public attributes (instance variables)
'isDirty: Set True if document needs to be saved
Public isDirty As Boolean
'newDoc: Set True if form was just created using New
'(no file on disk yet)
Public newDoc As Boolean
'docName: Set to filename of document (no path info)
Public docName As String
'pathName: Set to path (directory) where file saved
'(does not include filename)
Public pathName As String
End Class
|
|
|
|
|
if all you need is to write to a file, simply use the FileStream object in the frameworks
(if it is then the title of your message is VERY misleading, if not, then my reply is useless )
the basics are to create a FileStream object reference
Dim MyFileStream as System.IO.FileStream
and then you need to create the file stream, by opening the file
if it is a new file (there isn't a file with the same name at the same directory)
you should create the file like so:
MyFileStream = IO.File.Open(MyFilePath, IO.FileMode.CreateNew)
if the file already exists, you would probably want to erase the data and rewrite it do:
FileStream = SystemIO.File.Open(MyFilePath, IO.FileMode.Truncate)
to check whether the file exists use:
If System.IO.File.Exists(MyFilePath) Then ...
if you want to be really smart about it, you can scan the file to see what segements of have been chaged and only write those parts (mostly usefull in large files)
Fade (Amit BS)
|
|
|
|
|
Does anybody know how to get the ‘X’ click event?….the ‘X’ in the upper right hand corner of a form.
I want to perform a function if the ‘X’ is used to close the form (something like frmMain_ClickX) but if I use frmMain_Closing it causes certain functions to execute twice.
I’m assuming that frmMain_Click is not specifically associated with the click event of the ‘X’.
Thanks
Brad
|
|
|
|
|
Private Sub whatever_you_want(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
|
|
|
|
|
I’m still a bit confused.
I have the following sub that I want to be sure is executed whenever the form closes:
SaveData()
I have programmed the sub ‘SaveData()’ to execute under the ‘mnuExit_Click’ (and other areas).
My problem is that ‘SaveData()’ is executed once when ‘mnuExit_Click’ is executed and then again during frm1_cloising.
I assume that it is bad practice to just execute ‘SaveData()’ in ‘frm1_closing’ and in no other location.
Thanks
Brad
|
|
|
|
|
Brad Fackrell wrote:
I assume that it is bad practice to just execute ‘SaveData()’ in ‘frm1_closing’ and in no other location.
The reason why it's getting executed twice is because you execute it in the mnuExit handler AND your doing it again when the Closing event is fired. If you want to handle all possible ways of closing a form, then the Closing event is the way to go...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|