|
Please don't SHOUT. It's annoying and rude.
From MSDN
In order for a .NET Framework application to run on a given computer, it must have the .NET Framework installed. Any .NET Framework application that uses ADO.NET to connect to databases requires MDAC 2.7. Many computers already have these components installed; however, to ensure an application will run, these components should be redistributed with your application.
dotnetfx.exe[^] (for .NET 1.1)
dotnetfx.exe[^] (for .NET 2.0)
MDAC 2.8[^]
|
|
|
|
|
ramana mohan wrote: PLS SUGGEST THE REQUIREMENTS TO INSTALL IN THE OTHER PC
Create a setup and deployment package.
ramana mohan wrote: IS JUST DOTNET FRAME WORK SUFFICIENT
You need to have crystal report runtime libraries as well.
|
|
|
|
|
Still having same problem with formatting numbers in database. I am using the following code:
This is the function that I am calling
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As String) As String
FormatPartNumber = String.Format(formatstyle, partnumber)
End Function
Code to format number:
If Trim(row("formatcodeforitemnumber").ToString()) = "0" Or Trim(row("formatcodeforitemnumber").ToString()) = "" Then
FormattedPartnumber = FormatPartNumber("XXXXX-XXX", row("itemnumber").ToString())
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "1" Then
FormattedPartnumber = FormatPartNumber("XXXXX-XXX-XX", row("itemnumber").ToString())
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "2" Then
FormattedPartnumber = FormatPartNumber("XXXXXX-XXXX", row("itemnumber").ToString())
The number are not formatting at all. Any ideas!
jds1207
|
|
|
|
|
The part number is already a string, so it got formatted when you convert it to a string. You have to get it as a number to be able to format it into a string.
---
b { font-weight: normal; }
|
|
|
|
|
Could you give me an example?
|
|
|
|
|
jds1207 wrote: Could you give me an example?
An example of what?
How do you store the value in the database? Do you store it as a number? Otherwise you have to first convert it to a number to be able to convert it to a string again.
---
b { font-weight: normal; }
|
|
|
|
|
I don't think X works with numbers. It's 0
FormattedPartnumber = FormatPartNumber("00000-000", clng(row("itemnumber"))
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As long) As String
return partnumber.tostring(formatstyle)
End Function
|
|
|
|
|
I got the following error when trying to run project which was for this code
return partnumber.tostring(formatstyle)
Error message:
Unable to cast object of type 'System.String' to type 'System.IFormatProvider'. W
|
|
|
|
|
did you notice that I changed the argument type to LONG in the procedure definition?
I just tried the code and it worked fine. FormattedPartNumber = '03833-733'
Dim FormattedPartnumber As String = FormatPartNumber("00000-000", CLng("3833733"))
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As Long) As String
Return partnumber.tostring(formatstyle)
End Function
|
|
|
|
|
The numbers in the database are all showing as Xs now. Do you have any ideas?
|
|
|
|
|
you can't use X you must either use 0 or # (removes leading zeros).
my code that I sent along has the format of "00000-00" don't use X.
|
|
|
|
|
When I use 0 or # I get the error: Could not find installable ISAM.
|
|
|
|
|
does this code work for you?
Dim FormattedPartnumber As String = FormatPartNumber("00000-000", CLng("3833733"))
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As Long) As String
Return partnumber.tostring(formatstyle)
End Function
|
|
|
|
|
No, that code does not work. I want the number to be formatted when it is stored in the database.
|
|
|
|
|
Your original code indicates you want to format the value as your reading it from the database. If you want the database to have the formatted value then when you inserted the record you need to have it formatted at that point not as your reading it. if you want it to be displayed formatted then the code I gave does work.
|
|
|
|
|
The value is being read from a file and inserted into the database. I am not reading it from the database. The X that I am using will work when shown in the database with my original code. I am using X because they are used for the format code in the file. Here is some code that show the file I am pulling the values from:
Dim dttable As New DataTable
Dim row As DataRow
Dim CheckforProducts As DataTable
Dim FormattedPartnumber As String
Dim FormattedSupercedePartNumber As String
Dim Conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data Feeds\Current\Kawasaki\Jet Ski Trailer Generator;EXtended Properties=""TeXt;HDR=No;FMT=FiXedLength"""
Dim SQLstr As String = "SELECT TOP 5 * FROM IMINF010.dat"
Dim da As New OleDb.OleDbDataAdapter(SQLstr, Conn)
FormattedPartnumber = vbNull
FormattedSupercedePartNumber = vbNull
da.Fill(dttable)
For Each row In dttable.Rows
CheckforProducts = ProductExist(row("itemnumber").ToString(), "3")
If Trim(row("formatcodeforitemnumber").ToString()) = "0" Or Trim(row("formatcodeforitemnumber").ToString()) = "" Then
FormattedPartnumber = FormatPartNumber("XXXXX-XXX", CLng(row("itemnumber").ToString))
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "1" Then
FormattedPartnumber = FormatPartNumber("XXXXX-XXX-XX", CLng(row("itemnumber").ToString))
ElseIf Trim(row("formatcodeforitemnumber").ToString()) = "2" Then
FormattedPartnumber = FormatPartNumber("XXXXXX-XXXX", CLng(row("itemnumber").ToString))
If CheckforProducts.Rows.Count > 0 Then
UpdateProduct(FormattedPartnumber, "0", FormattedSupercedePartNumber, "0", RemoveQuotes(row("itemdescription").ToString()), "0", "0", "0", "0", "0", "0", row("dlrcost").ToString(), row("rtlprice").ToString())
|
|
|
|
|
Sorry, it is working now it was a mistake on my end. Thanks for the help!
jds1207
|
|
|
|
|
The code you gave me works but some part numbers have letters so I can't use long. Any ideas?
|
|
|
|
|
well that makes "auto-formatting" difficult(as far as I know).
if your format is static then you could do this
Dim sValue As String = "389393A1"
sValue = sValue.PadLeft(8, "0") 'put zeros in front to make the length 8
FormattedValue = sValue.Substring(0, 5) & "-" & sValue.Substring(5)
if it is not static then you may need to move each number/character individually into it's position in the format.
FORMAT 00000-000 'relates to position 12345-678
38347A37 ' 3 replaces 1, 8 replaces 2, etc...
|
|
|
|
|
jds1207 wrote: Unable to cast object of type 'System.String' to type 'System.IFormatProvider'.
That is because partnumber is a string.
The specific exception that you get is because there is no overload of the ToString method for the string class that takes only a string as parameter.
---
b { font-weight: normal; }
|
|
|
|
|
I just started learning Visual Basic. I'm learning by trying to develop my own personal web browser. I've been able to get it load the web page and have added functional buttons like a back and forward button. I've been trying to add a progress bar to the bottom. I have it added but I cannot seem to get it to work. I was wondering if anybody had any advice.
Thanks in advance.
|
|
|
|
|
You should tell us what you want to do with it?
I suppose you know how it works... easy... set the maxValue (or something similar) and increment the value in a loop, timer or what you need.
|
|
|
|
|
I basically want it to show the progress of the web page being loaded. Just not really sure how to do it.
|
|
|
|
|
That capability depends on the control your using. I've seen most only have an event of when it's fully loaded. If you can find an event called 'progress' or something like it then that's your best bet. If you can't I think your left with when it's done...
|
|
|
|
|
As said below,unless your web control offers an event as it loads data you are pretty much shot.
...however... you might want to consider something else. Unless you know the completed size of the page you are downloading, including graphics and all, a progress bar is not going to be easy since you will have no real idea as what number represents the 100% mark. Consider just using a progress bar that moves to do nothing more than indicate 'progress' and activity.
Something like...
http://www.codeproject.com/cs/miscctrl/BusyBar.asp[^]
|
|
|
|