|
hey a word of advice. don't ask people to write code for you it will piss them off. seriously, Just read the reply to the thread a few threads below yours. it is labeled;
please help me by telling me the code to the following problem.
so just a suggestion; change the wording on your next thread.
happy holidays
|
|
|
|
|
I have two tables in my xmlfile table0 and table1.table0 has 5 columns; itemid, checkno, payee, amount, & date. table1 has only one column; balance I need the tables to be joined together so that instead of my datagrid showing only table0 it will show both table 0 and 1. so since table0 is the first 5 columns i need to get table1 to be the 6th.the reason for this is because later on i am going to try to get amount from table0 to subtract from balance in table1 and the sum will end up in the balance column of the next row . this will eventually need to happen over and over again(loop). can anyone help me with joining these it would be greatly appreciated.
happy holidays
|
|
|
|
|
There should some common columns in both the tables to join, If you wish to join the tables. Table1 should have some primary key like itemId, and should become the Master Table. I would advice u to add the column in Table1.
Finally, It should be like
Table0
-----
ItemId
CheckNum
Payee
Amount
PaymentDate
Table1
-----
ItemId
Balance
Finally the query will be
Select A.ItemId, A.CheckNum, A.Payee, A.Amount, A.PaymentDate, B.Balance
From Table0 A, Table1 B
Where A.ItemId = B.ItemId
|
|
|
|
|
Also, make sure that Table0.ItemID is a unique primary key, or you'll potentially introduce data integrity issues.
if you want my opinion, there is no reason why your balance column should not be included inside of table0. If it is a true one to one relation like that then there is no need to create two tables and join them as that's just more overhead for your server to handle every time you request it and is just plain un-clean datbase design.
However if the balance is a one-to-many relationship, like a date range, then you'd need to include that column in table1.
given what you're saying there's just no need to include the balance column in a seperate table
'Cause I'm living on things that excite me, be it pastries or lobsters or love... I'm just trying to get by, being quiet and shy, in a world full of push and shove...
Jimmy Buffett - The Wino and I know
|
|
|
|
|
Please reply to Mr. beginner1 , By mistake your reply has come to me.
BTW, Thanks for added attension.
Regards,
Jay
|
|
|
|
|
So even if I want to make payee from table0 subtract from balance I can still do this if balance is included in table0?
Thanks
|
|
|
|
|
My mistake I meant amount subtract from balance not payee. so this will still work even if They are in the same table?
Thanks
|
|
|
|
|
Hi.
I really hope someone can help me on this as I have had headaches during the past few days trying to figure it out.
In VS.NET 2003, I create a Crystal Report called Customers.rpt using data from Northwind database on DEV_SERVERONE server. In my code this is how I load the report into the Crystal Report viewer on a Windows Form:
Dim UID, PWD, SRV, DTB as string
'read settings from the config file
UID = Configuration.ConfigurationSettings.AppSettings.Item("UID")
PWD = Configuration.ConfigurationSettings.AppSettings.Item("PWD")
SRV= Configuration.ConfigurationSettings.AppSettings.Item("SRV")
DTB = Configuration.ConfigurationSettings.AppSettings.Item("DTB ")
Dim rep As New Customers 'create new instance
rep.SetDatabaseLogon(UID,PWD,SRV,DTB) 'set the DB logon settings Me.CrystalReportViewer1.ReportSource = rep ' load the report
On my development machine, this code works seamlessly. When I deploy this application elsewhere, Crystal Reports opens up a dialog and prompts me for these settings. All the settings in the app.config on the customer's machine is ok. I am using SQL Server 2000 and VB.NET.
Please help me if you can because this is driving me nuts The worst part of it all is that according to MSDN, my code is supposed to work. I do not have that much experience with Crystal, so please give me some assistance if you can.
Thanks
Terrence J. Joubert
RUS Pty Ltd
|
|
|
|
|
I'm not sure how different the 2003 version is from the 2002 version but here's how you do it in VB.NET 2002:
Dim Rep as New MyReportFile() 'Class wrapper for Crystal report file
Dim MyLIS As New CrystalDecisions.Shared.TableLogOnInfos()
Dim MyLI As New CrystalDecisions.Shared.TableLogOnInfo()
Dim i as Integer
For i = 0 to MyRep.Database.Tables.Count - 1
MyLI = MyRep.Database.Tables(0).LogonInfo
MyLI.UserID = [User ID as String]
MyLI.Password = [User Password as String]
MyLI.ServerName = [SERVER Name as String]
MyLIS.Add(MyLI)
next
CrystalReportViewer1.LogOnInfo = MyLIS
............
'Cause I'm living on things that excite me, be it pastries or lobsters or love... I'm just trying to get by, being quiet and shy, in a world full of push and shove...
Jimmy Buffett - The Wino and I know
|
|
|
|
|
I have several classes in my project that I need to persist as XML. I achieved this by using serialization - I have load/save function in each class. Since I'm using the same routines in each class, it makes more sense to me to create a class with these routines in it, and then derive each class from this one. With me so far?
So, here is my base class (which the other classes will derive from):
Imports System.IO
Imports System.Xml.Serialization
Public MustInherit Class XMLSerializationBase
Public Sub SavetoXML(ByVal Filename As String)
Dim writer As StreamWriter = Nothing
Try
Dim ser As XmlSerializer = New XmlSerializer(Me.GetType)
writer = New StreamWriter(Filename)
ser.Serialize(writer, Me)
Catch ex As Exception
Dim strErr As String = String.Format("Unable to save file. Error: ", ex.Message)
MessageBox.Show(strErr, "File Save Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
If Not writer Is Nothing Then writer.Close()
writer = Nothing
End Try
End Sub
Public Function LoadfromXML(ByVal filename As String)
Dim reader As StreamReader = Nothing
Try
Dim ser As XmlSerializer = New XmlSerializer(Me.GetType)
reader = New StreamReader(filename)
Dim o = CType(ser.Deserialize(reader), XMLSerializationBase) '<------ HERE IS THE PROBLEM
If o Is Nothing Then Throw New NullReferenceException("Invalid file")
Return o
Catch ex As Exception
Dim strErr As String = String.Format("Unable to load file. Error: ", ex.Message)
MessageBox.Show(strErr, "File Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
If Not reader Is Nothing Then reader.Close()
reader = Nothing
End Try
End Function
End Class
Ok, so here is the problem When I deserialize the info, I need to convert it into a type of class - whatever type of class the base class is. So what I really want to do is this:
Dim o = CType(ser.Deserialize(reader), Me)
The problem is, this doesn't work - the IDE won't accept it. I also tried MyBase, Me.GetType, MyBase.GetType - none of these work, the IDE says that the object is not defined, or that it is an invalid type.
How to I tell CType to convert the info to whatever type of class my base class is???
-Todd Davis (toddhd@gmail.com)
|
|
|
|
|
Hello,
I want to create an OCX file using
Visual Basic .NET
How can I do that?
Best Regards.
Happy Christmas.
Thanks.
|
|
|
|
|
You can't. The VB.NET compiler will not target an OCX. You'll need to use VB6 or unmanaged C++ for this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i am using CR10, VB.NET, SQL
i have a table in SQL that has one of its fields as the address of a JPG picture. i want to use this address to display a picture in crystal report.
any ideas?????
thanks in advance
|
|
|
|
|
There are four guys trying to get home at night and in order to do so, they MUST cross a bridge. It's very dark and there is only one torch available. The bridge can ONLY support "TWO" person at a time. Now, a bomb has been set on the bridge which will explode in 18 mins. Due to the fact that each person's travelling speeds are different, therefore some will obviously take longer to cross than others.
The time that each person takes are as followed:
A = 1 min
B = 2 min
C = 5 min
D = 10 min
Torch = 1 Qty
Here's how it works: If D & A goes first, it'll require 10 mins for them to cross the bridge together. By the time A gets back with the torch to B&C...11 mins will be passed already.
The total time required is : 17 mins
the solution to it is:
A and B first - 2 minutes (max 2 )
A runs back with torch = 3 minutes
C and D Next = 13 minutes ( max 10 )
B comes back with the torch = 15 minutes ( max 5 )
A and B again = 17 minutes
Can anyone tell me the code to this problem in vb or vb.net please please. many many thanks in advance.
|
|
|
|
|
|
babur khan wrote:
Can anyone tell me the code to this problem in vb or vb.net please please. many many thanks in advance.
Like Colin said, a candidate for a genetic algorithm. Can we give you the code? Hell No! This is classwork! Get together with someone from class to hash this out. We can help with questions about problems you're having with code, but in no way will anyone here write the code for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HAI
I want to create a slide show program which has to show tga files as slide show presentation with full screen resolution can any body help me in the following
Which Control should i use image is not working because that will not support tga picture format....
Kindly help me....
|
|
|
|
|
|
hello,
i am trying to write a program that hooks an existing socket(opened by another application),
reads the data that the app is sending/receiving
and sends my own data through that socket.
if you dont know an excact solution, can you please point me to a tutorial about hooking sockets?
thanks,
GX
|
|
|
|
|
Simple, you don't. You can't hook a socket opened by another application. Just think of the security risks and you'll understand why.
Now, you CAN intercept the network traffic the socket rides on. This would require writting something akin to a packet sniffer. If your serious about this, then I suggest you can get an idea of what this involves by picking up the book "Network Programming in .NET". Try Amazon...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
then how do programs like WPE (winsock Packet Editor) and NetXRay work?
i have read a few tutorials on sniffers but that's not what i need. i need to be able to send data through that socket too.
thanks for the reply!
|
|
|
|
|
Those are also packet sniffers. They don't hook into an open port, but actually intercept ALL traffic going in and out of the NIC. Filters allow you to see the traffic on specific ports. This is what's probably making you think you can hook a port. If you can intercept all the traffic, you can also stop any traffic you want, alter any traffic you want, and create any traffic you want. Think of how a Firewall works.
Better yet, you a complete understanding of how this stuff works, pick up the book. Chapter 13 covers exactly what you're looking for. But I'd read the whole thing first.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you very much for making this clear for me!
i will read that book.
|
|
|
|
|
Hello,
Using VB.NET, I have developed a code which runs on PPC and XP.
For the moment I have two projects, one for Windows Application and one for Smart Device Application, and when I do a modification in one project, I copy and paste the code into the other project.
My question is: Is there a means to have only one single common file holding the code and which can be "loaded" in into one of both projects?
LeMat
|
|
|
|
|
I have a binary file (3D object file .LWO format) and I am having terrible joy getting the information out that i require.
The file consisits of several Chunks which relate to different 3D data. But for the moment I am interested in only 1 section known as the PNTS chunk. The file format viewed in a hex editor is as follows:
<br />
464F524D 0000017E 4C574F32 54414753 FORM...~LWO2TAGS<br />
0000000E 446B426C 75004465 6661756C ....DkBlu.Defaul<br />
74004C41 59520000 00120000 00000000 t.LAYR..........<br />
00000000 00000000 00000000 504E5453 ............PNTS<br />
00000060 C0000000 C0000000 C0000000 ...`À...À...À...<br />
40000000 C0000000 C0000000 40000000 @...À...À...@...<br />
C0000000 40000000 C0000000 C0000000 À...@...À...À...<br />
40000000 C0000000 40000000 C0000000 @...À...@...À...<br />
40000000 40000000 C0000000 40000000 @...@...À...@...<br />
40000000 40000000 C0000000 40000000 @...@...À...@...<br />
40000000 42424F58 00000018 C0000000 @...BBOX....À...<br />
C0000000 C0000000 40000000 40000000 À...À...@...@...<br />
40000000 504F4C53 00000040 46414345 @...POLS...@FACE<br />
00040000 00010002 00030004 00000004 ................<br />
00050001 00040001 00050006 00020004 ................<br />
00030002 00060007 00040000 00030007 ................<br />
00040004 00040007 00060005 50544147 ............PTAG<br />
0000001C 434F4C52 00000000 00010000 ....COLR........<br />
00020000 00030000 00040000 00050000 ................<br />
50544147 0000001C 53555246 00000001 PTAG....SURF....<br />
00010001 00020001 00030001 00040001 ................<br />
00050001 53555246 0000002A 44656661 ....SURF...*Defa<br />
756C7400 0000434F 4C52000E 3F48C8C9 ult...COLR..?HÈÉ<br />
3F48C8C9 3F48C8C9 00004449 46460006 ?HÈÉ?HÈÉ..DIFF..<br />
3F800000 0000 ?€.... <br />
The data I require is the list of points in the PNTS chunk, The first 4 bytes that follow the PNTS header text are the length of the chunk (so I am lead to believe). Following that each co-ordinate is made of 12 bytes, 3 axis create a co-ordinate X,Y,Z which are 4 bytes each. In this particular 3D model i chose a real basic cube 4m each side. so there should be 8 points to build the object. 8*12 = 96 which should be the same as the length set by the 4 bytes following the PNTS header. Whichever way i try to read the file the most I am able to get is the first Y co-ordinate to the end, therefore im always missing the first X co-ord of the first point, I have tried moving my current file positions to get this value but to no avail. Instead of pasting here every way i have tried to read this file, is there anyone here who could suggest the best way in vb.net to get this information?
I need to seek the PNTS Header, get the length of the PNTS chunk using the next 4 bytes, then read in the VB SINGLE vlaues to hold each x,y,z co-ordinates. The points are stored in IEEE Floating Point 32bit Hexadecimal. I can read in the HEX no problem but again I am not qualified enough to do the mathmatical conversion required to convert to decimal.
The points should be as follows:
-2: -2 : -2
2 : -2 : -2
2 : -2 : 2
-2: -2 : 2
-2: 2 : -2
2 : 2 : -2
2 : 2 : 2
-2: 2 : 2
For some reason when i read from the start of this chunk i always get -3.5 for the first co-ord when using the binaryreader object in vb.net
I would appreciate any help or pointers anyone can give me
Thanks in advance
Stewart
|
|
|
|
|