|
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[^]
|
|
|
|
|
Thanks everyone I appreciate the help.
|
|
|
|
|
on time selection option available in VB 6 ? 4 example when type A combo show display only those item that start with latter "A" and when type Ap then show only "AP" items
Fakhuddin
|
|
|
|
|
Hello,
Does anyone know how many copies a .net application can run? Example: If I have 75 users that are opening the same application, would it open 75 copies or just one (same .net) application.
I am running the .net application on 2003 sql server.
thanks in advance
programmer
|
|
|
|
|
how to generate a new label for every click event of a send button in panel in a new row in please see the code below.its working but not creating new label in a new line withfirst label vissible
i am trying to write code for chating application.Please help me as soon as possible..
private void btnSend_Click(object sender, System.EventArgs e)
{
System.Web.UI.WebControls.Label lbl=new Label();
lbl.Text=entr;
Panel1.Controls.Add(lbl);
}
|
|
|
|
|
When you create a label dynamically, it's default top/left properties will be zero/zero. if you use the control collection of the panel, find the last instance of the labels that you are adding and get it's top and height(adding a little for spacing) then set the new labels top to that number. otherwise each label will just sit on top of the one before it...
hope this helps...
|
|
|
|
|
thanks a lot ...i will try this
|
|
|
|
|
hellow to all ..
i am trying to build a nested datagrid in vb.net i was looking for codes and samples or for the method , i found some but didn't help me much ...
any one have any idea where i can found help on this issue ?
thxx
|
|
|
|
|
|
thank u but i need samples for vb.net not asp.net
|
|
|
|
|
Hello,
That problem solved, i entered the wrong name in the wrong place.
However, another question.
In my subreport I am grouping by an ID number (incidentTask.incidentID) and I don't what that to show in the report.
This is what I want:
TaskID Details Subject
At the moment the ID is being displayed and making a mess.
it is always repeating the data in the subreport.
Any ideas or tutorials.
Thanks,
Steve
-- modified at 9:35 Wednesday 1st November, 2006
|
|
|
|
|
Hello,
I have solved the above problems.
However, I have another problem.
I want to display something like this below:
[U]Parts Used[/U]
A
B
C
D
[U]Extra Parts[/U]
E
F
T
So what I need is a
Page Header section A
Details section A
Page Header section B
Details section B
The designer won't let me insert another report header after the detailed section A
Just another quick question. If one of the fields has no data in it, then it will display a blank line. Anyway to avoid this. In my address fields, some of the details the user does not enter.
Current
A
B
D
I would like to have
A
B
D
Many thanks in advance,
Steve
|
|
|
|
|
Hello,
I have solved the above problems.
However, I have another problem.
I want to display something like this below:
[U]Parts Used[/U]
A
B
C
D
[U]Extra Parts[/U]
E
F
T
So what I need is a
Page Header section A
Details section A
Page Header section B
Details section B
The designer won't let me insert another report header after the detailed section A
Just another quick question. If one of the fields has no data in it, then it will display a blank line. Anyway to avoid this. In my address fields, some of the details the user does not enter.
Current
A
B
D
I would like to have
A
B
D
Many thanks in advance,
Steve
|
|
|
|
|
using vb.net (any version) I am creating an instance of "excel". Now after completing the process the excel does not close the Process . What I want is to get the ProcessID of "Excel" object created inside my application. so that I can close it. I cannot blindly close all the excel running in the process list as Other users are connected to my machine and they might be running excel as well.
Any Suggestions ??
|
|
|
|
|
I'm not sure if this is possible without any neat tricks, but on top of my head I'm thinking why not save a list of all excel instances before creating the object, and compare it with a new list after creating the object, the difference should be your excel instance.
code might look like this
Dim proc As New List(Of Integer)
For Each p As Process In Process.GetProcessesByName("Excel")
proc.Add(p.Id)
Next
'Create your Excel object here
For Each p As Process In Process.GetProcessesByName("Excel")
If Not proc.Contains(p.Id) Then MsgBox(p.ProcessName) ' This is your instance
Next
of course if your using vb prior to .net 2.0 you can do the same thing with arrays, although more coding will be involved.
|
|
|
|
|
thanks but this will close the excel run by other users.
The problem is my application is running on server and excel object is created on server. so at a time there could be more then 1 excel objects in the list. now which one is the process initiated by my thread is the question. In system all the threads are started by userName="SYSTEM" so I cannot even differentiate with this. if there is any way to get the processID through object variable then it can resolve the problem .. any comments ?
|
|
|
|