|
I'm rookie programmer, and I try to code FTP by VB.NET.
And I have some problem in GetFile From FTP follow this code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ServFile As String = "TEST.ini"
Dim ServName As String = "192.168.1.148"
Dim User As String = "Test"
Dim Pass As String = "Test"
Try
mftp = New KCommon.Net.FTP.Session
mftp.Server = (ServName)
mftp.Port = 21
mftp.Connect(ServUser, ServPass)
mftp.CurrentDirectory.CreateFile("b.txt") ' Work
mftp.CurrentDirectory.PutFile("c.txt") 'Work
mftp.CurrentDirectory.BeginGetFile(ServFile)
' It not Work and have message
' "ex.Message"Remote file (TEST.ini) not found. ' Try refresh the directory." String"
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Thanks a lot for Ur Help.
|
|
|
|
|
I developed one project in VB6 before 1.5 year and it is running successfully till now. Suddednly a strange problem is reported by client. The problem is, to display any report,
user need to select From and To dates provided by DTPicker control and based on two dates report shows data between selected dates, but report shows from date as selected and To date of system date(today). Means From date is working fine but To date is always system date irrespective of selection of any date from dtpicker.
I checked the code and i have not written any code to change selected date as system date. what can be the problem?
thanks.
Atul
|
|
|
|
|
1. this is a web application.
2. there are 2 pages. page1.aspx and page2.aspx
3. I'm using sql server.
I am using 1 table in the server to collect all the data. When the user logs in they are taken to the first page(page1.aspx) here they are asked to input some of the data. The application creates a new record with a unique identifier called form_id. The user inputs the data and is then taken to page2.aspx. Here the user is to update the new record(from page1.aspx) they just created but i can't seem to be able to tell the application to go to the database and retrieve the last record entered.
|
|
|
|
|
Hi,
many ways.
one is use output parameter in stored proc. and return latest id generated by page, get back id and pass it in querystring, from page2, get record by passing new id.
another way is use a query like use max function for id, but this might cause problem in multiuser environment.
Atul.
|
|
|
|
|
check books online for scope_identity()
"People who never make mistakes, never do anything."
My Blog
|
|
|
|
|
hi there iam newbie in programming can any one explain me the idea of looping i have a database with 4 fields srno, filename, month, year in table "check" i need to loop field month so that the record avaiable in database will appear in my asp page can any one explain i try this loop
<%
dim strRemarks
if isnull(rst("reportMonth"))= true or len(rst("reportMonth"))=0 then
strRemarks="None"
else
strRemarks=rst("reportMonth")
end if
%>
<%
rst.MoveNext
loop
rst.Close
set rst=nothing
%>
but it not working
regard
ybasha
|
|
|
|
|
What's not working about it? Please be more specific in your postings so that we don't have to read your entire code to find out - that ultimately benefits us all
I presume you do have a line similar to Do While Not rst.EOF to match the closing Loop statement? Good.
Be wary of compound or statements like this:
if isnull(rst("reportMonth"))= true or len(rst("reportMonth"))=0 then
because you may find that BOTH sides of the or may be evaluated before the result of the If is resolved. It could be that either the LHS or RHS of the or is throwing an exception?
...Steve
|
|
|
|
|
Ok here is my problem...
i got an third party app connecting to a server on a specific port and i have to retrive the ip of the server it is conected to like i can do with "netstat"
can you give me a hint how i could do sth like that?
I already thought about just parsing theo output of netstat but that would be quite dirty...
regards lukas
|
|
|
|
|
Good morning to everyone!
I have created an Udp Class to handle UDP communication (using the UdpClient class provided by the Framework).
To correctly handle the receival of data I have created a new thread (this is also shown in the many examples found on the internet). My problem is: if I try to assign the data received to a textbox (for example) an exception is raised since the window (the textbox) was created in a different thread. This is not a big problem (the exception is raised only at design time and not at runtime) but I'd like to know if there is a way to avoid this problem.
Thank you!
|
|
|
|
|
Hi im fairly new to VB.NET or programming for that matter. I was wondering how I could pass data from one form to the other with additional data from a database.
Here's the case...I've a web app that displays various company department in which when i click on my view button it shows the machines that are assigned to them. Now here is my problem...every machine displayed on my datagrid has a detail link which i would hopefully like to show the details of the machine including serial number, date of purchase, supplier, product ID etc. Only...im not sure how to do it. Logically i think i would have to use a primary key ("Prodict ID") then use it as reference on what the other lbl boxes would display.
Could someone please give me a headstart on how to go about doing this. Thanx for all your help and suggestions!
Kampai!!!
|
|
|
|
|
Create the corresponding object variables in the second form,
pass as a parameter to that form before loading the form,
Perform the related operations on 'ON-LOAD' event
"He that is good with a hammer tends to think everything is a nail." - Abraham Maslow
|
|
|
|
|
On-Load....oh Page_Load. Yeah I've figured then pass each label as a parameter. Wow thanx! This'l be one hell of a query...
Kampai!!!
|
|
|
|
|
You can pass the product ID on the URL to a page that calls a stored procedure to get the details for that one product.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Woah ur also post here at VB.NET. U must really be good!
I did think about that chris...well sumthing like that...im just wondering if i could post every information in separate labels in one code. Is that do-able or do i have to assign each labels their corresponding data manualy?
Kampai!!!
|
|
|
|
|
tatchung wrote:
U must really be good!
LOL - actually, I've never used VB.NET, and I doubt I ever will. But I know enough about the framework, and questions like this one are really language neutral, so I keep an eye out here as well.
tatchung wrote:
...im just wondering if i could post every information in separate labels in one code. Is that do-able or do i have to assign each labels their corresponding data manualy?
I'm not sure how you mean ? I would be inclined to turn all those labels into a control. I'd also be inclined to have a class which defines one of these objects and can read it's properties from the database when passed an ID for either a constructor or a static create method. Then your control sets each label, one by one ( the only way it can be done ), getting the properties from a class. The class fills those properties from a database call. And all your main page does is pass an ID off to the control.
Sorry, does that sound confusing ? Let me know if you need more info.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yeah...had to read your post bout 3 times LOL!. But that was exactly wat i was looking for. I was searching for a quick way which sets all labels automaticaly without having to set them one by one. Thanx chris!
Kampai!!!
|
|
|
|
|
Great - just ask again if you get stuck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Will do! Thanx again!
Kampai!!!
|
|
|
|
|
I have a listview that I want to align the icons so that it only goes horizontal and will be able to scroll that way..not vertical.
Any way to do this in vb.net?
|
|
|
|
|
I'm making some application, and I'm using a collection of objects to handle the data, the objects inside the collection has some other collections as parameters, I'd like to know if there's a way to create a databind to a datagrid of some information contained in the objects inside my collections, any help will be greatly appreciated.
|
|
|
|
|
Here are some hints that may help you solve your problem.
When you create a class that with several Set/Get Properties defined and then create an array of objects of that class then you can set your datasource to your and the datagrid shold have complete access to all the properties of your class or you can add a DataGridTableStyle to your datagrid and add DataGridTextBoxColumn for some of the properties of your class.
Since you can populate a main datagrid then you can populate another datagrid that show the collections that are inside your first collection.
Hope this makes sense.
|
|
|
|
|
Hey sorry about the late answer, actually I couldn't make it work binding the objects so i had to find an alternate way, but actually if you have a reference about this I'd really appreciate if you could pass it to me, cause I'm still interested about this.
thanks
|
|
|
|
|
Hi all
I want to learn VB.Net. If anybody know the website addresss for vb.net tutorial which is best for beginners.
Thanks
|
|
|
|
|
I recommend this site, and learning C# instead. However, MSDN has heaps of info on both, and so does this site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi I don't know at what level you are looking for but there is this website that gives you an over view of vb.net. This website gives you a basic idea I am beginner and I tried many websites and books and found this reasonable.
check it out www.startvbdotnet.com.
Good luck
|
|
|
|