|
Looks like you are picking up the short version of the path name.
Can you try placing your entire command line in double quotes when you enter it in? Might help preserve the argument you are passing in.
c:\ "program_name.exe c:\very\very\very\long\file\path.filename.txt"
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Hello
I have been trying to development a id generator but don't know exactly how to do it. The id must have an abbreviation + year(05) + id ie. refernce=abbrev+05+id. If anyone can give some advice on this it is much appreciated. Also if it helps the abbrev comes from a database on sql server.
Thank You
Paul Mc Gann
gfhg
|
|
|
|
|
I'm not exactly clear on what you mean by "id" generator. You're using "id" to refer to the entire reference (abbrev+05+id) and as the last part of the reference. Are you asking how to concatenate abbrev, 05 and id? Or how to generate a unique string to tag onto the end of the reference? Or what?
Do or not do. There is no try.
|
|
|
|
|
How about making an idGen table, with an auto_increment column in it:
Create table idGen <br />
(GenID int not null auto_increment,<br />
Abbrev varchar(3),<br />
Year char(2))
Then, when you need a new Unique ID, insert into this table and retrieve the id inserted:
Insert into idGen (Abbrev, Year) values ('AA', '05')<br />
select Abbrev + Year + ltrim(str(GenID))<br />
where GenID = @@identity
Roy.
|
|
|
|
|
Hey Paul,
AS I Understand you want code to generate the unique Id
So here is the code
Public Function GenerateID() As String<br />
Dim length As Integer<br />
Dim guidResult As String<br />
length = 10<br />
<br />
guidResult = System.Guid.NewGuid().ToString()<br />
'removes the hyphen<br />
guidResult = guidResult.Replace("-", String.Empty)<br />
<br />
Return guidResult.Substring(0, length)<br />
<br />
End Function
BY this code you can generate the desired length Unique ID
Hope this works for you.
Hema Chaudhry
|
|
|
|
|
Hi,
Does anyone know if it is possible to format a floppy disk using vb.net
Thanks
John
|
|
|
|
|
System.Diagnostics.Process.Start("c:\winnt\system32\format.com", "A:")
But, I don't think that's what you want since it displays the format DOS window.
Do or not do. There is no try.
|
|
|
|
|
Your probably looking for the Shell function SHFormatDrive[^]. This will open up the standard Format dialog you get when you click on Format in a drives context menu in Explorer.
Private Declare Auto Function SHFormatDrive Lib "shell32.dll" ( _
ByVal hWnd As IntPtr, ByVal drive As Integer, _
ByVal fmtId As Integer, ByVal options As Integer ) As Integer
...
Dim retVal As Integer
retVal = SHFormatDrive( Me.Handle, 0, 0, 1 )
hWnd is the handle to the parent window of the dialog, usually the current form's handle.
drive is the 0-based drive number. 0 for A:, 1 for B:, 2 for C:, ...
fmtId is the format code. 0 for 1.44/1.2MB floppies, 3 for 360KB, 5 for 720KB.
options is the format type. 0 for a Quick Format, 1 for Full Format, and 2 to copy the system files to the floppy.
The options are filled into the dialog. You can't just format the disk without the user interface using this function.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I Want To Source Code For List All Hardware & Software In Your Computer
I Do Project About Support Computer But I Don't Know About Code For Find Hardware & Software In Computer Help Me Please
-- modified at 4:38 Wednesday 21st December, 2005
|
|
|
|
|
Can any one help me...
i want to copy one table from one database to another
Sasmi
|
|
|
|
|
You mean you want to write a tool to do this?
<< >>
|
|
|
|
|
Are you talking about MS SQL server? On MS SQL server the best and fastest way is to use import or export wizard from one database to another.
or if you have SQL expeirece just create script for table create and create it in destination and next use SQL query to copy data from source to destination. You can also create SQL statement which will automatically create table on insert for you. But I think that for you import/export Wizard is the best solution.
jpazgier
www.jpazgiersoftware.com
|
|
|
|
|
Hi!
Asuming that you are using MS SQL Server
You need to avoid primary key and null value violations on your own
Use
Insert Into [Source Database Name].[Object Owner Name].[Destination Table]
From
[Destination Database Name].[Object Owner Name].[Source Table Name]
Example:
Insert Into NorthwindBackup.dbo.Products
Select * from NorthWind.dbo.Products
Or
Insert Into NorthwindBackup..Products
Select [Fields List] from Northwind..Products --name, data type and sequence of the fields must be the same as in destination table
--you may include your WHERE clause here
|
|
|
|
|
Hey All,
In my application I have Print Feature
Now What I want that as the User Click on Button Print
I have shown Printer Dialog Box to Select the Printer
Now AS user selects the printer I want to know about the Selected printer
is a :
Laser Printer
Dot Matrix
Or Label Printer etc
After determining the printer I have perform a certain task
My Problem is How to determine the printer type (Laser etc.) after selection from the user????
Hope My Question is Clear
Wating for all early replies
Thanks in advance
Hema Chaudhry
|
|
|
|
|
The InstalledPrinters collection has an IsPlotter property; but, I don't think printer type other than plotter is readily available. If anyone knows better, I'd like the answer to this one also.
Do or not do. There is no try.
|
|
|
|
|
|
Thanks for the Precise answer,
But I have tried this earlier also; I gives an exception In the following line , I can;t understand why is this giving this type of exception (System.NullReference)
Dim intMarking As Integer = CType(mo("MarkingTechnology").ToString
can U get the problem
If Yes Plaz resolve this
Thanks a lot
Hema Chaudhry
|
|
|
|
|
I am connecting to a database. now i trying to get the information about database like Backup info, database size, Owner, Creation date etc.
How can i get this information? Any help will be appreciated.
|
|
|
|
|
I work with SQL Server, so I don't know if this helps with other DBMS's, but have you tried looking in the Master database, system tables? There is a wealth of information about the databases in there.
Roy.
|
|
|
|
|
I have a very simple xml file
<RegistrationSettings>
<SMTPServer>mail.not-real.com.au</SMTPServer>
<FromAddress>from@not-real.com.au</FromAddress>
<HostName>Jason</HostName>
<HostAddress>jason@not-real.com.au</HostAddress>
</RegistrationSettings>
and I want to read a single value out of that, for example: <HostName>
I don't know how to do this
This is the code I have at the moment (inItemName = "HostName")
Try
xmlobjReader = New XmlTextReader(_XMLPath)
xmlobjReader.WhitespaceHandling = WhitespaceHandling.None
While xmlobjReader.Read
If xmlobjReader.Name.ToLower = inItemName.ToLower Then
itemValue = xmlobjReader.Value
End If
End While
Catch ex As Exception
itemValue = ""
Finally
If Not xmlobjReader Is Nothing Then
xmlobjReader.Close()
End If
End Try
At the end of this code itemValue == ""
I know this should be easy, but I can't see what I am doing wrong.
Thanks for any help
/jason
|
|
|
|
|
Jason,
The parsing of the XML was not quite correct. Try this amended code.
Try
xmlobjReader = New XmlTextReader(_XMLPath)
xmlobjReader.WhitespaceHandling = WhitespaceHandling.None
xmlobjReader.MoveToContent()
Dim isHostName As Boolean
Do While xmlobjReader.Read
Select Case xmlobjReader.NodeType
Case XmlNodeType.Element
isHostName = (rdrXML.Name.ToUpper = "HOSTNAME")
Case (XmlNodeType.Text And isHostName)
itemValue = xmlobjReader.Value
End Select
Loop
Catch ex As Exception
itemValue = ""
Finally
If Not xmlobjReader Is Nothing Then
xmlobjReader.Close()
End If
End Try
Step through the code in the debugger and inspect the various variables to see what's happening.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Thanks for your help Steve, but in the end I decided not to go that way. I decided it was too slow to loop throw each element in the XML and check it's type etc
instead I have used a dataset
Public Sub New(ByVal inXMLFilePath As String)
_XMLPath = inXMLFilePath
_dsRegistrationValues = New DataSet(_DATASET_TABLE_NAME)
_dsRegistrationValues.ReadXml(_XMLPath)
End Sub
<br><br>
Public Function ReadItem(ByVal inItemName As String) As String
Dim returnSettingValue As String
returnSettingValue = _dsRegistrationValues.Tables(0).Rows(0).Item(inItemName)
Return returnSettingValue
End Function
I got the idea from this article, if you are interested
http://www.codeproject.com/vb/net/ConfigOpt.asp[^]
/jason
|
|
|
|
|
That's a neat solution Jason. Thanks for the link. I'll check it out.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
How can you import 2003 VB.net codes or application into VB.net 2005?
Dmaster
|
|
|
|
|
Visual Studio 2005 includes a VS 2003 conversion tool. It will automatically update the VS 2003 project to VS 2005 when you open it.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|