|
Although everything functions okay, I want to get rid of this warning (VS2005):
Warning: Type library exporter warning processing 'myCOMClass.FTPUtils.FTPdirectory, myCOMClass'.
Warning: Type library exporter encountered a type that derives from a generic class
and is not marked as [ClassInterface(ClassInterfaceType.None)].
Class interfaces cannot be exposed for such types.
Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and
exposing an explicit interface as the default interface to COM
using the ComDefaultInterface attribute.
I have create a COM Class with the following structure:
Imports System.Runtime.InteropServices
<Guid("AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE")> _
Public Interface ImyCOMClass
Function FTPUpload(ByVal localFileNameFull As String, ...) As Boolean
Function FTPDownload(ByVal localFileNameFull As String, ...) As Boolean
End Interface
<ClassInterface(ClassInterfaceType.None), _
Guid("FFFFFFFF-GGGG-HHHH-IIII-JJJJJJJJJJJJ")> _
Public Class myCOMClass
Implements ImyCOMClass
Public Function FTPUpload(ByVal localFileNameFull As String, ...) As Boolean _
Implements ImyCOMClass.FTPUpload
Return (New WebUtilities()).UploadFile(localFileNameFull, ...)
End Function
Public Function FTPDownload(ByVal localFilenameFull As String, ...) As Boolean _
Implements ImyCOMClass.FTPDownload
Return (New WebUtilities()).DownloadFile(localFilenameFull, ...)
End Function
End Class
I added ftpclient.vb which you can find at http://www.codeproject.com/vb/net/FtpClient.asp to my project.
So the structure is:
myCOMClass.FTPUpload -> WebUtilities.UploadFile -> New FTPUtils.FTPclient().Upload
The above mentioned warning is caused by the following definition in ftpclient.vb:
Public Class FTPdirectory
Inherits List(Of FTPfileInfo)
Some suggestions?
|
|
|
|
|
I've written a simple routine to load a comma-delimited data file into an Access table, and I would like to automatically clear the receiving Access table before inserting the new data. The problem is that I can't find any tips on how to do that. Using the MyTable.Clear( ) command seems to only clear the in-memory version of the table, not the external table on the hard-drive. At the very worst, there must be a SQL command that I could execute to empty the table so that I don't append the new data to the old.
Does anyone know how to accomplish this? Thanks for any help.
Michael AJ
|
|
|
|
|
MAJackson wrote: At the very worst, there must be a SQL command that I could execute to empty the table
Simple in SQL
Delete * From Table
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
S Douglas,
Thankyou, it worked perfectly.
code:
DataConnection.Open()
oleDbCommand.CommandText = "Delete * from Table1"
oleDbCommand.ExecuteNonQuery()
DataConnection.Close()
Obviously I will have to learn SQL. Especially since I want to reset the automatically generated key values to start from 1 every time. My guess is that I will have to remove the table from the database, and recreate it in code, each time I reload the table. But then...I really don't expect to run this program more than once, anyway.
It was a case of loading the data by hand...over many weeks; or writing a program to do it...over many weeks...and getting a learning experience out of it. This way was a lot more fun.
Michael A.J.
|
|
|
|
|
MAJackson wrote: Thankyou
Your welcome.
MAJackson wrote: Obviously I will have to learn SQL.
The basics; C.R.U.D. (Create, Read, Update, Delete)
C == Insert into Table (column) values ('value')
R == Select Column From Table
U == Update Table Set column='value'
D == Delete * From Table
All of those queries support the where clause, where is filtering for specific data.
There is lots to learn, I sugguest a good ADO.NET book and a TSQL book.
MAJackson wrote: Especially since I want to reset the automatically generated key values to start from 1 every time. My guess is that I will have to remove the table from the database, and recreate it in code, each time I reload the table.
That's a lot of work and you loose all of that data, consider creating a seperate table with one integer column using that as the counter and every week resetting it back to one. When you need a new number read the current value increment by one and update it. Add a new counter column to your current schema and leave the primary key there to do its thing.
MAJackson wrote: It was a case of loading the data by hand...over many weeks; or writing a program to do it...over many weeks...and getting a learning experience out of it. This way was a lot more fun.
Nothing like letting a computer do what it was designed to do.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi all.
(windows forms).
How I can get the text of a textbox that is on other app?
Example:
I have an app running that has a textbox which Text property is "MICROSOFT VISUAL STUDIO ROCKS!".
I want to make an application that will obtain the handle of that textbox and get its contents (its text property value). I already have the code that obtain the handle.
I think that I need to use WM_GETTEXT in conjunction with OpenProcess, WriteProcessMemory, SendMessage and ReadProcessMemory. But I have no idea how to do it.
Please help me.
Thx in advance.
Best regards,
Marco Alves.
|
|
|
|
|
Hello,
I am looking out for a logic to calculate the date according to the no. entered in the textbox. For e.g. as the form gets loaded in runtime it displays the current date in the date control, and there is one text box in which numeric value 5 is specified and the third part is their is one more date control on the same form which will add 5 days to the current date and display.
For e.g.
In first date control current date is displaying as 29/08/2006
In the textbox below numeric value 5 is specified by default.
In second date control which is just below the textbox should display 03/09/2006
it has jumped to next month even
does any body knows how it can be done, waiting for kind and quick response.
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
Use the AddDays method of the DateTime class to add a number of days to a date:
DateControl2.DateProperty = DateControl1.DateProperty.AddDays(Int32.Parse(TextBox.Text))
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much it works but i changed the code little bit by typing datecontrol.value instead of date property and it works fine
Thanks a lot.
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
How Can i create a control that add to my other controls a propierty like tooltips. for example when you add to your form a tooltips control all the control appear with a new property name tips. i need to know how can i make for my control do that.
Magno R. Vasquez (Gbyte)
|
|
|
|
|
Hi,
I am having problem adding a datatable into a database. I have a gridview in my form, that gets it's datasource programmatically using a data adaptor.
gv.datasource = mydatasource
In my properties window, I enable editing, adding and deleting for the gridview.
Now I have a problem to add the new rows/columns(update) back to the database, programmatically.
Is there any way to do this?
|
|
|
|
|
First, when you configured your data adapter did you add update/insert statements?
If yes, then here's how to do it.
1. Create a new datarow off your dataset,
2. Add data to that datarow.
3. Add the row to the dataset.
3. Update the data source through the data adpaters Update method.
e.g. some sample code to update a name & surname to a database. (ds1 = dataset, da1 = data adapter, conn = connection).
'create a new datarow off a dataset
Dim dr As DataRow = Ds1.tblNames.NewRow
'add data to the row
dr.Item("Name") = txtName.Text
dr.Item("Surname") = txtSurname.Text
'add the new row to the dataset
Ds1.tblNames.Rows.Add(dr)
'update the data source
Try
conn.Open()
da1.Update(Ds1)
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
conn.Close()
End Try
You will obviously need to perform validation on the data to ensure that it is valid but that's the basic idea.
Hope that helps.
|
|
|
|
|
Hi,
Can we do the Web Part(ASP.NET) type functionality in Windows Form. If anybody having any idea or article, could you please share with me?
|
|
|
|
|
Hello Dear,
I want to develop a program that will be connecting to two or more computers which will be located in two or more diferent countries (e.i. USA and other country). It'll be kind of a chat program. If I were to open a business in another country while I am residing in the USA, I want to abe able to check my business through this program.
I have experience writing programs that run just in local computers. I have a good understanding and experience with the languages below. It is my first attemp to develope an application or program of this magnitude.
Tools I have available :
VB 6.0
VB.NET
C++.NET
MS SQL Server 2000
MY SQL
Microsoft Access
** I know some COM+
Would any one give me his/her suggestion.
--I would like to know how to do the connection between two or more computers located in diferent countries.
--Do I have to talk to my telephone service company to give me some access point. Or I can just simply use the internet?
--In terms of Development:
+ Which of the above languages will be more efficient for this project?
+ Should I use Remoting, Webservice, or TCP/IP Connection?
Any suggestion, idea or brainstorming will be appreciated.
Thank you
Amadeo
Amadeo
|
|
|
|
|
Hi
First you need the I.P of the other computer that you want to connect to. Either it must have a static ip / dynamic ip. If it is static ip then you can connect to that computer easily. if it is dynamic ip, you need some application to run on the dynamic ip machine to inform the current ip that it has been assigned.
hope this helps.
Kanniah
|
|
|
|
|
How can i open pdf file and stamp on all the pages using VB.net
Mansoor
|
|
|
|
|
Hi
Is it possible to display all child records of a datarelation and not just one at a time? I want a grid that the user doesnt have to open the child relation to see the contents, all parent and child records must be displayed.
If not with the datagrid that comes with Visual Studio, any free controls that can?
Thanks
Izak
|
|
|
|
|
Have you thought of perhaps using a TreeView control?
|
|
|
|
|
Hi
I need to edit the information in the child records
|
|
|
|
|
Dear Sir
Can I make setup for a program and run it onto a machine
that has not Visual Studio nor .Net framwork?
|
|
|
|
|
In VS 2005 use the publish option. This will create an install app on either a server or a path that you might want to cut to a CD. Part of the Prerequisites under the publish setup screen is to include .Net 2.0. If you leave this checked when you publish it will help when the client goes to install the app. When they install it from your CD or server, if .NET 2.0 framework doesn't exist, it will automatically install it.
Hope this helps
Lost in the vast sea of .NET
|
|
|
|
|
Dear Sir
How can I install a .Net FramWork when I make a setup for a program which made by VB.Net?
|
|
|
|
|
My dear friend,
if you are developing an application or program in .NET than you have to make sure that the target computer has .net framework in it. If the target machine does not have .Net Framework then do an update from Microsoft. Otherwise, your application will not work at all.
|
|
|
|
|
Hello,
You have to install .net framework on client machine before istalling your application developed in .net. Or else while deploying your application just include dotnetframe work which u can see in solution explorer(dependencies), during deployment. If you include dotnet frame work the file size of your application, i.e, your setup.exe will increase by 30 mb max. And when ever you will try to install your application on the machine which does not have framework it will istall the framework first automatically and then start with the installation of your actuall application, else if it will install only your actual application.
Try it out
Bye.
Nikhil Bandekar
Mumbai,
India
|
|
|
|
|
Dear Sir
I thank you for your answer
Please I want more details, since I add the setup file for .NET FrameWork onto the Application Folder (i.e. the Setup Solution) but when I run the program
onto another machine the .NET FrameWork does not setup automatically with it.
Good Luck
MNG
|
|
|
|