|
If you have specific questions about a networked application then please ask them, nobody here will email you for this.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
abbss.gaurav wrote: im new to he world of vb.net, so i don't know anything
Buy a book. No-one can answer your question, you have not asked one. If you have specific questions, ask them. If you're totally lost, buy a book and learn the basics.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There was no query to answer in this message.
|
|
|
|
|
Hello,
Can anyone please help me. I am new to VB.Net. I want to do a program that lists all the comm ports and the device name if any connected to those ports. For eg. we have a credit card reader connected to a port and it shoud display Comm1 : Moneris Credit Card Device. This is to help users to setup their initial settings for the program.
Thanks
|
|
|
|
|
There's no way to ID the device attached to the port. There was never a specification to identify serial devices. You can TRY certain commands that you know the device will respond to, and how it will respond, but most devices won't just plain old tell you "I'm a whatever" with a single well-known command. It just doesn't work that way.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
|
Could someone help me? I am trying to pass optional dates via a function.
I have VB.Net 2003.
What am I doing wrong? I keep getting asquibbly line under the zeros.
Here is a sample of the code.
Public Function myFunction(ByVal sSQL As String, Optional ByVal dToDate As Date = 0, Optional ByVal dFromDate As Date = 0) As Boolean
|
|
|
|
|
My first gut reaction is that 0 is not a valid date. I would try putting a valid date in. I would try something like #3/28/2007#
Hope that helps.
Ben
|
|
|
|
|
IS_Assessor wrote: I keep getting asquibbly line under the zeros
Asquibbly: The new word of the day!
Like kubben said, for Optional Paramaters you need a default value and 0 (Zero) isnt a valid date value
SELECT * FROM Users WHERE Clue > 0
ERROR: 0 Rows Returned
|
|
|
|
|
hi
i have a windows application. I am select the folder or file name
from the folderbrowserdialog box and to delete the folder or file i am
calling the following code.
Public Function DeleteFile(ByVal path As String) As Boolean
'Delete a specified file
Try
If File.Exists(path) = True Then
File.Delete(path)
Return True
End If
Catch ex As Exception
Throw ex
End Try
End Function
Public Function DeleteFolder(ByVal path As String) As Boolean
'Delete a specified folder
Dim objFileInfo As FileInfo
Dim objFolder As DirectoryInfo
Dim objSubFolder As DirectoryInfo
Dim dirInfo As DirectoryInfo = New DirectoryInfo(path)
Try
If Directory.Exists(path) = True Then
objFolder = New DirectoryInfo(path)
For Each objFileInfo In objFolder.GetFiles()
objFileInfo.Delete()
Next
If dirInfo.GetDirectories.Length = 0 Then
Directory.Delete(dirInfo.FullName)
Return True
Else
For Each objSubFolder In
objFolder.GetDirectories()
DeleteFolder(objSubFolder.FullName)
Next
End If
DeleteFolder(objFolder.FullName)
Return True
End If
Catch ex As Exception
Throw ex
End Try
End Function
but i have to show the progress bar during the files or folder
deletion.
so plz tell me what should i do.
Pankaj
|
|
|
|
|
You need first to get a count of the files and folders you're going to delete, then you just increment the progress bar after every delete call. Directory.GetFiles will give you a string array of files without that DirectoryInfo stuff. File.Delete will delete them. You should store the paths as you're counting them, so you don't need to get them twice.
It would work better to use a BackgroundWorker to do the deleting, and call it's ProgressUpdated event to update your UI, but calling Application.DoEvents() whenever you update the progress is easier and should work fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm really stuck on this one.
I've got an mdi parent (with a single menustrip) + one mdi child (with no menu strips).
When I maximize the mdi child, it separates the mdi parent title bar and mdi parent menu bar, inserting a new line between them containing only the child icon and child control box.
Even stranger, when I close the app while a child is maximized, it distorts the size and location of the mdi parent (saved in My.Settings) by the height of this new "strip". So, repeatedly opening and closing the app with a child maximized causes the mdi parent to "creep" - the height decrements by the height of this mysterious "strip."
I have a tiny sample app to demonstrate the problem.
Can anyone help me out of this?
(I'm using VS 2005, vb.net 2.0)
Thanks.
Pat
|
|
|
|
|
I'll answer this one myself, just in case anyone else runs into it...
In VS 2005 designer, select the MDI parent form and set the MainMenuStrip property equal to the menu strip that you placed on the MDI parent. That's all it takes to merge child icons and child control boxes with the parent's menustrip! I don't recall this from VS 2003 (or .net 1.0) and it might be the source of much menustrip confusion in VS 2005 MDI.
|
|
|
|
|
And what error are you getting ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using this basic code to run a DTS package.
Dim oPKG As New DTS.Package
With oPKG
.LoadFromSQLServer("DEV", , , _
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, _
, , , "HR_LoadData")
oPKG.Execute()
oPKG.UnInitialize()
oPKG = Nothing
End With
It works so great I would now like to run some DTS packages that reside in sql server on a different domain. What code do I need to get to a different domain?
|
|
|
|
|
I would like to ask what is the best db system that I can use to store data(ex:MDB or SQL)?
and secondly could some one tell me how to use the .mdb system I whet through a lot websites but non of those sites have a clear coding.
I found this one: but this just writes the columns, is there a practical way to use mdb.(I want to be able to use .mdb to its fullest capacity)
- any help is extremely appreciated -
ps:
can you also give me the codes to save data to db as well
(by the way I don't know anything about using db in vb .net)
------------------------------------------------------------------------
Try<br />
Dim ds As DataSet<br />
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;")<br />
'provider to be used when working with access database<br />
cn.Open()<br />
cmd = New OleDbCommand("select * from table1", cn)<br />
<br />
dr = cmd.ExecuteReader<br />
While dr.Read()<br />
TextBox1.Text = dr(0)<br />
TextBox2.Text = dr(1)<br />
TextBox3.Text = dr(2)<br />
' loading data into TextBoxes by column index<br />
End While<br />
ds = New DataSet<br />
D1.DataSource = ds.Tables<br />
Catch<br />
End Try<br />
dr.Close()<br />
cn.Close()
----------------------------------------------------------------------------
|
|
|
|
|
.mdb just means a microsoft access database which uses VB code behind it. SQL is a language to access data from a database such as SELECT * FROM TBL_CODEPROJECT. If your database is small Access is easier you don't have to code a lot for simple things. If you need a larger database then you can look at SQL Server (2003, 2005 or Express--which is free) to store your data then using something else (such as Access/VB, a .NET environment to access the data inside the database.
_________________________________________
You can't fix stupid, but you can medicate crazy.
|
|
|
|
|
thanks, can you give me the coding for both?
|
|
|
|
|
|
The old function:
Format(InputDateString, "00/00/00") would take in something like 032807 and return 03/28/07 .
I cannot seem to reproduce this with:
InputDate = String.Format("MM/dd/yy", InputDateString) or
OutputDateString= InputDateString.ToString("MM/dd/yy") Am I even close to figuring this out? I am trying to avoid the VB6 functions as much as possible.
As for the Mid() = that would be like saying:
Mid(InputRecord, 99, 5) = ReplacementString Is there a replacement for this other than
InputRecord = InputRecord.Substring(0, 99) & ReplacementString & InputRecord.Substring(99, InputRecord - 99)
-- modified at 8:55 Wednesday 28th March, 2007
Referring to the Formatting piece, if I first convert the string to a numeric value then use:
ConvertedValue.ToString("00/00/00") Then it works great how come I cant seem to get it to do anything from the original string?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
1) For the mid function use Substring(startIndex(zero based), length)
Dim strOriginal As String = "My String"
Dim strSub As String = strOriginal.Substring(3, 2)'Returns "St"
|
|
|
|
|
I understand substring Im really asking about the replacement capability of the Mid function.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
The Mid function didn't do replacements. It just returned a substring from a string.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you perform the following function:
Mid(InputRecord, 99, 5) = ReplacementString It will indeed substring out the piece you dont want and replace it at the same time with the new string.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|