|
Lorenzo wrote: I would like to create basic classes to interoperate with records (ex. movefist, movelast, findfirst) and use them in my specific objects.
I searched if some sample was inserted in internet, but i didn't find any solution.
ADO.NET works differently.
You might want to read up on the following classes: DataSet , SqlDataAdapter , SqlDataReader , SqlConnection , SqlCommand
|
|
|
|
|
I am now totally confused. You also don't appear to be the OP.
|
|
|
|
|
The scenario is i have a multiline text box, the user enters some range of values in that, separated by a "-"
ex:
10.1-20.2
30.3-40.4
50.5-60.6
I have to read this values & split each of them & also we need to push each value in an integer
like i1 = 10.1, i2 = 20.2, i3 = 30.3 & so on.
FYI:I'm using vb.net 1.1.
Can anybody help me how do we do this.
|
|
|
|
|
Dim arValues as Integer() = txtMultiLine.Text.Split("-")<br />
For i as Integer = 0 to arValues.GetUpperBound(0)<br />
integervalue = arValues(i)<br />
Next
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Hi,
this is what my code is
Private Function testFunction(ByVal str As String)
Dim lines() As String
Dim s As String = "-"
Dim before, after As String
' Split the contents into lines.
lines = Split(str, vbCrLf)
If lines.Length > 0 Then
For i As Integer = 0 To lines.Length - 1
Dim mypos As Integer
mypos = InStr(lines(i), s)
before = lines(i).Substring(0, mypos - 1)
Dim il As Integer
il = lines(i).Length
after = lines(i).Substring(mypos)
If CInt(after) <= CInt(before) Then
Response.Write("First Item is greate than second")
End If
Next
End If
End Function
But the problem is i even want to check that the last item in lines array should be less than the first item of the next lines()
i.e. 1.5-2.5
3.5-4.5
4.0-5.0 'Note:here 4.0 is not valid as in the last item we already had 4.5
I hope you got it
|
|
|
|
|
I need to write a program that will navigate to a website, login, and download several files on a daily basis. I have no Idea where to begin on a project like this. If anybody has some code examples of how best to do this I would be very appreciative. I am not limited to VB.net for this project if someone fills another language would be better for the job please tell me.
Thank You, Russell
|
|
|
|
|
in vb.net 2005 look at my.Computer.Network.DownloadFile
|
|
|
|
|
This is great code for doing direct connections like to a SFTP or https site. But do you know of any examples that show how to make a mini web-bot that only goes to one site everyday and navigates through a manual user login then has to select the correct report button and then copies and saves the report to file.
If the company That I need to get the reports from would give us some sort of FTP, or SFTP, or direct http/https URL to work with the first examples you gave would be great. Well in the mean time I will keep working with the examples you supplied and see if I can get something working. Thank you for the link to the examples and wish me luck I am going to need it.
Russell
|
|
|
|
|
there is some example in codeproject.com that someone did that used a browser control in his vb.net application and using the dom object, clicked buttons, etc. search for it and see if you can adapt it to what you need...
|
|
|
|
|
You can use the System.Net.HttpWebRequest() and System.Net.HttpWebResponse() to do this.
Do the login and navigate the web page with HttpWebRequest, then parse the HTML code (got by HttpWebResponse) and get the link for download file(s).
Bye,
Carmine,
Webmaster of: www.thetotalsite.it
My web blog: blog.thetotalsite.it
|
|
|
|
|
I want to play a sound file when i load a form in my vb.net 2005 file.
The file format is .wav, and i simple want it to play when the form is opened, and [if possible] stopped when the form is closed, nothing more than that.
How would i do this.
Cheers
|
|
|
|
|
look at my.Computer.Audio.Play
|
|
|
|
|
K, cheers.
Sorry, should have also asked, how do you add a sound file to the resources, i cannot find its file type, do you use stream or something like that???).
Sory, bit slow at this VB stuff!
|
|
|
|
|
project properties
resources
add existing file
to play My.Computer.Audio.Play(My.Resources.xxxxxxxx, AudioPlayMode.Background)
note; it appears that it will only play pcm wave files. might need to use api call unless yours is pcm...
|
|
|
|
|
Yeah its a PCM file, recorded it in Windows Sound Recorder, i inputted it into vb.net, it shows up on the list, but not on the input list (see screenie), any ideas?
See geocities.com/webharv/error.JPG
|
|
|
|
|
if it's in the resource list then I don't know. As a work a around, add it to the project (not the resource area) and use the physical path to play the sound...
|
|
|
|
|
how to attach macromedia falsh file with vb.net project?
|
|
|
|
|
You need to add a Shockwave flash object from: Window -> Choose toolbox items, in the COM componentes tab check the Shockwave flash object
Alexei Rodriguez
|
|
|
|
|
ya i hav added shockwave objects then
Place the Flash MX file in bin folder of the project.
double click on the form and write code on form load event
Button1.Text = "Play"
double click on the button and wrilte the following code on the Button1_Click event
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Movie = Application.StartupPath & "\segment1.swf"
AxShockwaveFlash1.Play()
this code is not working.
|
|
|
|
|
Hi, all.
I have a problem reading csv files with quotes embedded in a field, below is a sample of the data I'm trying to read, I have no control over the formatting of this file.
"A",32140,"Router Cutters & Accessories"
"A",32141,"Hinge Hole Cutters & End Mills"
"A",32148,"Step Drills"
"A",32149,"Subland Drills"
"A",32150,"Long Drills"
"A",32151,"Drill Blanks"
"A",32152,"Stub Drills"
"A",32153,"Extra Length Drills"
"A",32154,"Taper Pin Drills"
"A",32155,"Blacksmiths or 1/2" Shank Drills" 'this line is the problem
"A",32156,"Centre Drills"
"A",32157,"Socket Drills"
"A",32158,"Heavy Duty Drills"
"A",32159,"Micro Drills"
"A",32160,"MT Shank Drill"
"A",32161,"MT Shank Extra Length"
"A",32162,"MT Shank Heavy Duty"
"A",32163,"MT Shank Long Drill"
"A",32164,"1/4" Shank Drills" 'so is this one
"A",32165,"Spotting Drill"
"A",32166,"Short Carbide Tipped Drill"
"A",32167,"MT Shank Carbide Tipped Drill"
the code is:
Dim _TCode as string, _ItemCode as long, _Description as string
FileOpen(filenumber, _Path & File.FileName, OpenMode.Input)
While Not EOF(filenumber)
Input(FileNumber, _TCode)
Input(FileNumber, _ItemCode)
Input(FileNumber, _Description)
wend
=error "read past eof"
is there anybody who can help me to read these two lines without error.
Many thank in anticipation.
|
|
|
|
|
Dim sLine,sa(),sCode,sItemCode,sDescription
Open "TESTFILE" For Input As #1
Line Input #1, sLine ' Read line into variable.
Do While Not EOF(1)
sa = split(sLine,",")
sCode = Replace(sa(0),"""","")
sItemCode = Replace(sa(1),"""","")
sDescription = Replace(sa(2),"""","")
Call ProcessRow(sCode,sItemCode,sDescription)
Line Input #1, sLine ' Read line into variable.
Loop
Close #1
|
|
|
|
|
Thanks for your reply,
I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
Regards Alan
|
|
|
|
|
alanhauxwell wrote: I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
You will probably need to parse the string that you read in...
a , followed by " is end of field
end of line is end of field
or some such thing...
Hopefully, you will never get a comma and a double-quote adjacent to each other in your data
Hope this helps
|
|
|
|
|
Hello!
In Windows task manager there are "USER NAME", "CPU" and "MEM USAGE". I would like to know how I can reach these values in vb.net. I am currently able to list all the running processes but no clue how to display the others. I have tried but couldn't get others working Thanks for your help!
Here is my simple code in vb.net /2005
<br />
Private Sub LoadProcessModules()<br />
<br />
Dim myProcesses() As Process<br />
Dim myProcess As Process<br />
Dim I As Int32 = 1<br />
<br />
myProcesses = Process.GetProcesses()<br />
<br />
' Iterate through the process array.<br />
For Each myProcess In myProcesses<br />
I = ListView1.Items.Count<br />
ListView1.Items.Add(myProcess.ProcessName)<br />
ListView1.Items(I).SubItems.Add(myProcess.Responding)<br />
Next<br />
<br />
End Sub<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
You can use the PerformanceCounter class - there's a bit of an example here...[^]
|
|
|
|
|