|
Simple. You have two tables (Table1 and Table2). Table2 has records that relate to records in Table1. The only thing holding the relationship is the fact that the two tables share a common field:
Table1: Table2:
recID ID# of record recID ID# of record in table 1
Name Some name Info1 Some information related to table1
Address Some address Info2 Some information related to table1
Both tables share a recID field. But, Table2 can have multiple records with the the same recID from Table1, this is a 1-to-many relationship. One record in Table1 is related to Many records in Table2.
The problem your running into is there is a recID in Table2 that doesn't exist in Table1. It's a record that doesn't have a relationship to any record in Table1.
You can probably code a SELECT statement to find the 'orphaned' records in Table2 for you, but I don't know exactly how to do it.
|
|
|
|
|
Hi...I've designed a form (winform) using VB.net standard. I used the data form wizard to construct it. It has a parent table record and 2 child table datagrids connected via oledb. I'll get into the construction when all of a sudden I get this message "DataBinding could not find a row in the list that is suitable for all bindings." What the hell is this? I can't find it anywhere in the knowledgebase or newsgroups. It is driving me crazy. The form code (.vb) is still there but the form (designer) is all screwed up. This has happended several times. Am I the only one who has experienced this. Microsoft....are you there?
Thanks in advance,
Mike
|
|
|
|
|
hey, i'll post this again, it got deleted last time..
All i wanna know is where I can find some GOOD tutorials for VB.Net
I've read my textbook several times...
Possibly a tutorial for graphics (games)
Thanks
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
Please someone one respond!!!
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
Please someone respond!!!
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
|
I am using VB.Net and would like to obtain a list of all the running applications on a PC.
I have looked at the Process Class but don't know if this is the right/best/simplest way of achieveing what I want.
I only need to list items with user interfaces (windows) not services.
Any ideas apreciated.
|
|
|
|
|
Don't worry, someone posted the following code sample which solved my problem:
Dim current As Process = Process.GetCurrentProcess()
Dim processes As Process() = Process.GetProcesses
Dim ThisProcess As Process
For Each ThisProcess In processes
'-- Ignore the current process
If ThisProcess.Id <> current.Id Then
'-- Only list processes that have a Main Window Title
If ThisProcess.MainWindowTitle <> "" Then
ListBox1.Items.Add(ThisProcess.ProcessName)
End If
End If
Next
|
|
|
|
|
http://files.danen.org/h/prg_vbnet.shtml will be the repository for my project files. Solutions to MY problems.
Feel free to contribute.
The entire http://files.danen.org/ site contains programming and networking related downloads.
Enjoy!
Gerry
|
|
|
|
|
I am facing very simple problem (i alreday overcome from this problem before but at the moment i am unable to find the way )
Problem is
I am writting(saving) a excel file from program ... before saving the file i open a "ShowSave" dialog from which i am taking the file name from it ... ( the dialog box prompt for ALREADY EXISTS file .. if any) ... but when i am finally going to save the file from "WorkBook.SaveAs" Microsoft Excel againg prompt from Overwrite message. I want to avoid this "OVERWRITE Message" ... since i already asked from user before ...
I know this can be done (since i already done this VC long time ago ) but how ...
Please help ...
Any word, code, sample, web site, any thing will help me lot
Thanx to all in advance
|
|
|
|
|
I got it ... it is
AppExcel.DisplayAlerts = False
Thanx for all
But there is one more problem i am facing and this is when EXCEL.EXE is still in running condition, even i close the Application. I check it through Task Manager. For closing the Excel Application I use following code.
AppExcel.DisplayAlerts = False
wBook.SaveAs FileName:=strFileName, FileFormat:=xlNormal, ConflictResolution:=False
Set wSheet = Nothing
Set wBook = Nothing
AppExcel.Quit
Set AppExcel = Nothing
After last line i check the Task Manager ... their is still a EXCEL.EXE running ....
How i resolve this ...
Again thanx in advance
|
|
|
|
|
uSQL = "Insert Into OrderDetails2 (OrderNumber, ProductCode, ProductDesc, Quantity, Price) " & _
" Values (" & iOrderNo & ", '" & strCode & "', '" & strDesc & "', " & iQuantity & ", " & iUnitPrice & "," & iFullPrice & ")"
Set RS = Conn.Execute(uSQL)
Me.Adodc3.Refresh
Me.DataGrid2.Refresh
the above code is used to populated the datagrid first time round, by the click event of a command button. Price relates to UnitPrice*Quantity, which is calculated prior to the population of the grid, on the click of a command button. i cant edit the quantity in the datagrid directly due to the calculation that is required for FullPrice (ie Qty * Price). so instead i change the quantity in the datagrid (all other columns except FullPrice are set to locked) and press an "Edit" button which contains the following code:
Dim strCustomerCode As String
iOrderNo = txtOrderNo.Text
strCustomerCode = Me.txtCustomerCode.Text
strProductCode = DataGrid2.Columns("ProductCode")
DataGrid2.Columns("ProductCode").Locked = True
DataGrid2.Columns("ProductDesc").Locked = True
iPrice = Datagrid2.Columns("UnitPrice")
Dim iGridQty As Integer
DataGrid2.Columns("Quantity") = iGridQty
iFullPrice = iPrice * iGridQty
DataGrid2.Columns("Price") = iFullPrice
DataGrid2.Columns("Price").Locked = True
With Adodc3.Recordset
Dim editSQL As String
editSQL = "Update OrderDetails2 " & _
" Set OrderDetails2.Quantity = " & iGridQty & ", " & _
" OrderDetails2.Price = " & iFullPrice & " " & _
" where OrderDetails2.ProductCode = '" & strProductCode & "' AND OrderDetails2.OrderNumber = " & iOrderNo & ""
Set RS = Conn.Execute(editSQL)
End With
MsgBox ("Record Updated")
The record updates fine in the table but when i leave the datagrid ,i get the following error message: "Cannot be updated for updating. Some values may have been changed sinse it was last read". What am i doing wrong? If you need any more information or explanation, please let me know - any help would be greatly appreciated!
|
|
|
|
|
I'm very new to .net .... any help is much appreciated!
I'm using vb.net and visual studio.net to build a form. This form has two textboxes (textbox1 and textbox2). I'm trying to drag and drop the value of textbox2 into textbox1. Further, after the drop, I went textbox2 to retain the value of textbox1. A swap. See illustration below:
Figure 1 - The initial state of both textboxes
Textbox1 Textbox2
15 37
Figure 2 - The state of the textboxes after the drag and drop
Textbox1 Textbox2
37 <----- 15
So far, I've gotten this to work:
Textbox1 Textbox2
37 <----- 0
I've debugged what I've done so far, and checked the call stack. What's happing so far is:
1. The mousedown event occurs on textbox2. This even triggers the drag and drop event of textbox1
2. In the textbox1.drag_and_drop(), I've added some code to set textbox1.text = <new value="">
3. Control is returned back to textbox2.mousedown() where I set textbox2.text = 0
I've tried overloading the procedure textbox1.drag_and_drop() to include a 3rd, byRef, argument oldValue as String, that I set to the original value of textbox1.text. However this doesn't compile because textbox1.drag_and_drop() HANDLES dragdrop.
My question is this: What's the easiest way of getting this done? If I'm going down the right road, how do I overload the dragdrop event so that I can implement this 3rd argument? If I overload the event, do I need to recreate all the code associated with dragdrop?
|
|
|
|
|
Hi!
I'm trying to find a way of retrieving the serial number of all the hard drives in a PC, not the Volume information, but the real hard drive, manufacturer serial number!
I know i must use a virtual device driver file, but i don0y actually know how to do it!
Where can i find a sample code, or just a good article on this subject?
Thank you for your time
|
|
|
|
|
Are you using VB6 or VB.NET ?
For VB6, I would do this :
In the Menu Project->References : Select 'Microsoft Scripting Runtime'
Then in your code :
Dim fso As FileSystemObject
Set fso = New FileSystemObject
MsgBox fso.Drives("c").SerialNumber
Set fso = Nothing
I'm not sure if this is exactly what you need.
Jerome
|
|
|
|
|
Thank you Jerome
I'm using VB6, i did as you told me, and i got a number, like : 134763457, maybe this number is related to the partition serial number, because, once i have 2 partitions in this hard drive, for "e" i got another number.
What i needed is the vendors serial number that can be read on the hard drive.
Do you know a way to do this?
Thank you once more
|
|
|
|
|
I understand now exactly what you want. You're right, the number you get is the Serial number of the volume. I'm afraid I won't be able to help you on how to get the manufacturer serial number, I've got no idea how to get it...
Sorry,
Jerome
|
|
|
|
|
Thank ok, thank you the same
|
|
|
|
|
I want to set the layout orientation settings of a printer in a client machine..
using an dotnet page I have to set these property in the client machine... & then to print..
I know there we cant change programmatically the settings such as the page orientation or the default printer.
so can I use an activexControl instead or is there anyway to overcome this problem..
pls let me know..
Regards
Thoths
|
|
|
|
|
|
I'm looking for the way to create the custom menu in VS.NET for my Addin.
As you know, if you create the addin with Visual Studio.NET Addin Wizard and choose [Create the TOOL menu] then .NET generates the code in OnConnection Sub like following..
CommandObj = applicationObject.Commands.AddNamedCommand(objAddIn, "MyAddin1", "MyAddin1", Executes the mommands for MyAddin1, True, 59, Nothing, 1+2)
CommandObj.AddControl(applicationObject.CommandBars.Item("Tools"))
This will insert the MyAddin1 menu in TOOL menu when it's first loaded.
I wanna creat my custom Menu like MyAddins next to Tool menu, then insert addin's menu into it...
If anyone know the way to do it, please tell me. Thanks.
|
|
|
|
|
Hello,
In previous version of vb we used to use .inc files like .h files in c++,
how is the changed in vb.net ?
Thanks for your reply
|
|
|
|
|
Use "imports", e.g., "imports system.io"
Gerry
|
|
|
|
|
Hello gerry,
I am a C++ programmer, now in the world of VB.net
as in c++ world where we have .h files where we define
the integer,string...array etc, is there some thing
in vb.net world. where I could define all constants
and global variables and include them in all files.
or should all of them be defined in a module and include
that module in the project while compiling.
bijju
|
|
|
|
|
Not sure, Bijju.
"Imports system.io" for example imports (includes) a namespace that you can then refer to in your code, like additional classes.
system.io comes from system.dll (I believe) so you could create a DLL and then make a reference to it in your project, or you can copy a source file to your project.
I used to keep a number of "global" .h files in a special directory that I made known to the compiler, so it would know where to find it. You can probably do the same thing in vb .net, but I've only been using vb .net a month, so I'm learning as I go along.
Good luck,
Gerry
|
|
|
|