|
<b></b>Hi all, I am new to VB.Net and need help. I want to write some code that will set a environment variable in DOS that I can use within DOS - or more precisely I want to create a command line exe file that will set a variable called mydate equal to today’s date in yyyymmdd format. The full code would be most welcome if possible.
Regards
wrh
|
|
|
|
|
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
|
|
|
|
|