|
|
Thank you Graus i'm going to check it now , Anyone who helps you is your friend "A friend in need is friend in deed now we are friends"
Thanks alot!
|
|
|
|
|
hi, can anyone help me on how to add a row of data in an existing datagird, can i add new row of data without using database or hidden row in datagrid? i have a webform which creates pop up. In that pop up, the users are required to key in data, and the data will add to the datagrid in the main page. i cannot add a new row of data there...
i am new to vb.net, anyone can help? thanks in advance
|
|
|
|
|
Is there a single command that will tell me if an Array = nothing i.e. no data in array
This would be a 2 dimensional array. What I am looking for is something list this
If Array <> Nothing then
****do something
else
****do something else
endif
|
|
|
|
|
(In .NET) You are right about the <> Nothing part, but if the array has been initialized then this will not work. You could try If (Array.Length > 0 Then), this will tell you if anything is in the array if it has already been initialized.
|
|
|
|
|
hi there ,
say i have a few tables ... is it possible to search for the data i want by using a form .. ??
i have done so by using filters .. but is there other ways of doing it ?? 1 more thing .. i can only filter by the data in the columns , but what if i want to display only the few columns i select in the form ... how do i go about it ...
<br />
pnl.text , pf.text and product.text are combo boxes .. the rest of the combo boxes contain columns as the data not rows ...<br />
<br />
If pnl.Text = "ON" Then<br />
Range("B6:CJ178").Select<br />
<br />
Selection.AutoFilter Field:=1, Criteria1:=pf.Text<br />
Selection.AutoFilter Field:=2, Criteria1:=product.Text<br />
<br />
ElseIf pnl.Text = "OFF" Then<br />
Range("B180:CJ291").Select<br />
<br />
Selection.AutoFilter Field:=1, Criteria1:=pf.Text<br />
Selection.AutoFilter Field:=2, Criteria1:=product.Text<br />
<br />
ElseIf pnl.Text = "ON & OFF" Then<br />
Range("B293:CJ504").Select<br />
<br />
Selection.AutoFilter Field:=1, Criteria1:=pf.Text<br />
Selection.AutoFilter Field:=2, Criteria1:=product.Text<br />
<br />
End If<br />
|
|
|
|
|
Hi
Could anyone help me with a small problem. I am trying to print using vb.net. I can use the following line of code to print using vb6.
Printer.Print "Reference No.: " & frmWorkOrder.txtFindWO.Text
How do I do the same in VB.net
Thanks
|
|
|
|
|
Is it possible to simulate the following key press sequence in a VB program.
Sequence <alt> <prnt scrn="">
i.e. so it acts as if these keys were actually pressed.
Thanks,
|
|
|
|
|
The sequence was ALT PRNT SCRN, but used angle brackets so not show in original post.
|
|
|
|
|
hi , can anyone help me please?
i'm new to the vb.net
i want to download web pages from the web into local files , i used URLDownloadToFile from the microsoft site :
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Dim llRetVal As Long
llRetVal = URLDownloadToFile(0, "http://www.yahoo.com", "c:\Temp.htm", 0, 0)
but nothing happened .
why?
|
|
|
|
|
You used the declaration for VB6, which won't work in VB.NET because the type names are now different sizes. By this, I mean that in VB6, a Long is a 32-bit signed integer. In VB.NET, the Long type is a 64-bit signed integer. The declaration should be:
Private Declare Auto Function URLDownloadToFile Lib "urlmon" _
(ByVal pCaller As IntPtr, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Integer, ByVal lpfnCB As IntPtr) As Integer
You'll call this with:
Dim returnCode as Integer
returnCode = URLDownloadToFile( IntPtr.Zero, "http://www.whatever.com", "C:\MyDownloadedStuff", 0, IntPtr.Zero )
I don't know if it'll work exactly like this because I haven't tried it...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It may be 3.5 years nearly since this was posted, and it has taken HOURS to find it, but thank you, thank you, thank you. I sort of twigged this was the problem but did not know how to fix it.
|
|
|
|
|
Are there any ways to delete a directory that is NOT empty? (In Vb.Net)
I used System.IO.Directory.Delete, but the directory has to be empty..
|
|
|
|
|
Or are there other ways to delete a folder that is NOT empty as well?
|
|
|
|
|
If your supply the Directory.Delete method with the name of the directory and True, it'll delete everything inside the directory you want to kill off.
System.IO.Directory.Delete("C:\TEMP", True)
will delete C:\Temp and everything inside it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a trouble with Ms.Access. I don't know how to add a new record into the specific table inside the VBA-code enviroment of a form.
For examples:
I need to add a new record into the table called 'tblA'. The work is done inside the code VBA of a form.
please,help me...Thanks so much
|
|
|
|
|
Don't you just use SQL to add a record ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
======================================================
Friend Class LCOtherInfo()
protected ss as string
public sub new(byval x as string)
ss=x
end sub
end class
=====================================================
Dim x As New LCOtherInfo(x)
When i create instance of LCOtherInfo but i has an error,"can't obtain value".
Please tell me the way!!!!!!!!!!!!
|
|
|
|
|
TooLeeDiN wrote:
Dim x As New LCOtherInfo(x)
You need to pass a string in here, you're passing in x, which is also the name of the variable you're trying to create.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Can someone please help me in understanding why this code will not work in visual basic .net 2003 ?
I have generated a text file from an access database and I'm trying to read it with my program so hopefully I can manipulate it and write it back to a file. I am having issues with textfieldparser it doesn't appear to exist. Is there an easy way to do this? A working example with a simply txt file would be wonderful or a very step by step tutorial on a website. Thanks for your time.
[code]
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
Dim oFileDlg As New OpenFileDialog
If oFileDlg.ShowDialog() = DialogResult.OK Then
Dim sr As New System.IO.StreamReader(oFileDlg.FileName)
MessageBox.Show(oFileDlg.FileName)
sr.Close()
End If
Dim reader As Microsoft.VisualBasic.FileIO.TextFieldParser
reader = My.Computer.FileSystem.OpenTextFieldParser _
("C:\TestFolder1\test1.txt")
reader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited
reader.delimiters = New String() {","}
Dim currentRow As String()
While Not reader.EndOfData
Try
currentRow = reader.ReadFields()
Dim currentField As String
For Each currentField In currentRow
MsgBox(currentField)
Next
Catch ex As System.Text.Parsing.MalformedLineException
MsgBox("Line " & ex.Message & _
"is not valid and will be skipped.")
End Try
End While
End Sub
[/code]
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
win32newb wrote:
Dim sr As New System.IO.StreamReader(oFileDlg.FileName)
MessageBox.Show(oFileDlg.FileName)
sr.Close()
Do you really want to just open and close it there ?
I would forget this, and just use a normal text file reader, read a line at a time and use the split function on the string class to split by ,.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim oFileDlg As New OpenFileDialog<br />
Dim Somestuff As String<br />
If oFileDlg.ShowDialog() = DialogResult.OK Then<br />
Dim sr As New System.IO.StreamReader(oFileDlg.FileName)<br />
Dim mystring As String<br />
<br />
mystring = sr.ReadToEnd()<br />
Dim objMatches As MatchCollection ' a collection of the matches<br />
Dim objReg As Regex<br />
Dim objMatch As Match<br />
<br />
<br />
<br />
objMatches = objReg.Matches(mystring, "/(0\d-\d\d\d\d-\d\d.{5})(.{29})(.{6})(.{9})(.+)\s+SERVICES: ==METERED==\s+.+LAST READING\s(.*)\s+==NON METERED==\s.+---TYPE---\s(.*)/Um")<br />
<br />
<br />
<br />
<br />
<br />
<br />
Dim I As Integer<br />
For I = 0 To objMatches.Count - 1<br />
Somestuff += objMatches(I).Value<br />
<br />
<br />
<br />
Next I<br />
<br />
sr.Close()<br />
End If<br />
TextBox1.Text = Somestuff<br />
End Sub<br />
End Class<br />
Can you take a look at thisi code please and tell me why the heck TexBox1 always contains " " ?
here is a sample of the text file i'm reading in.
<br />
---ACCOUNT---- ------------NAME------------ CLASS -STATUS- -SERVICE / MAILING ADDRESS--<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
01-0005-00 PHILLIPS & LUCKEY COM ACTIVE 102 Blah<br />
PO BOX 1417 Blah, TX 765671417, B009<br />
<br />
SERVICES: ==METERED==<br />
-SERVICE CODE- TBL ACT ----DESCRIPTION---- SCALE DIALS UNITS METER NO# LAST READ DATE LAST READING<br />
10-WATER 5 Y COMMERCIAL 1.000 7 1.00 56914331 6/05 0<br />
<br />
==NON METERED==<br />
-SERVICE CODE- TBL ACT ----DESCRIPTION----- STEP/QUAN ---AMOUNT--- ---TYPE---<br />
I'm eithter real close to getting this resolved or way way way out in left field
thanks for the help
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
What does the / at the start of the regex do ?
It looks like your text is multiline, are you setting your regex to work across multiple lines ? It does not look that way to me.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This was for perl where you type / to indicate a regexpression start. Dang I'm confused of how to port this hahaa. Oh well this is fun learning.
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
Search this site for Expresso and download it. Perl regex and .NET regex are different in a number of ways. Expresso will let you type in a regex, and see what it matches, using .NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|