|
just_starting wrote:
I have made a windows service which I want to install on other machines.So far I have done the installation by using the installutil.exe. But this method is cumbersome.Is there any shortcut method to do this.
Add a new Windows Installer project to your solution and add your EXE assembly to whatever directory you want to register for the path to the service. Click the View -> Editor -> Custom Actions menu. Right-click on the root node and select Add Custom Action. Find your DLL you added to the File System editor and compile. This will run the Installer derivative in your Windows Service assembly automatically.
just_starting wrote:
Can I install my windows service on a machine which doesn't have .net installed.
If your Windows Service is managed, then no. .NET applications require the .NET Framework, just like Java apps require a JVM and probably the JRE, MFC applications require the shared MFC library (unless you statically link and bloat your application), VB6 apps require the VB virtual machine, Perl scripts require the Perl runtime, and the list goes on and on.
To deploy the .NET Framework with your Windows Installer package - because it won't do it out of the box for you, read Creating a Single SEtup Project to Install a .NET Framework Application and Dotnetfx.exe[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I tried the method you specified but was still unable to install the service. It is still asking to install it using InstallUtil.exe.
help needed..
|
|
|
|
|
You must make sure that you have a class that derives from Installer and that it is attributed with the RunInstallerAttribute with true as the parameter.
When you add the assembly to the Custom Action view - while it should be automatic - make sure that the "InstallerClass" (or something like that) is set to True.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I'm tring to add a row at my database .mdb but i get the follow error: "Sintax error in the INSERT INTO instruction" why? what do i wrong?
this is the schema of my database:
Nome: text 15
Domanda: text 20
Risposta: text 15
Email: text 20
this is the code:
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data source= myDatabase.mdb;";
try
{
conn.Open();
OleDbDataAdapter myAdapter = new OleDbDataAdapter("SELECT * FROM myTable", conn);
OleDbCommandBuilder myCmd = new OleDbCommandBuilder(myAdapter);
DataSet myDataSet = new DataSet("myTable");
myAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
myAdapter.Fill(myDataSet, "myTable");
DataRow myRow = myDataSet.Tables["myTable"].NewRow();
myRow["Nome"] = mNuovoUtente.mName;
myRow["Domanda"] = mNuovoUtente.mQuestion;
myRow["Risposta"] = mNuovoUtente.mAnswer;
myRow["Email"] = mNuovoUtente.mEmail;
myDataSet.Tables["TabellaUtente"].Rows.Add(myRow);
myAdapter.Update(myDataSet, "myTable");
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}
|
|
|
|
|
please can someone answer me?
|
|
|
|
|
Well, the first problem is that your table doesn't show a primary key. Without it, .Update() won't work. Second, you, apparently, don't have an Update command associated with the DataAdapter. Third, if the Primary Key information is missing, you set the .MissingSchemaAction , but never called .FillSchema before you called .Fill .
You last problem is coming back here demanding an answer to your problem. We do this in our spare time and don't get paid to do it. If you don't like the speed at which the developer community answers your questions, take it up with our supervisors! Oh! Sorry, we don't have any supervisor here! We're just a bunch of volunteers... :->
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave Kreskowiak, i thank you for your answer but i don't understand why you tell me that.
The only thing i tryed to do was avoid to make my thread disappear, infact right after some minutes other user with their posts have make my post jump at the second/third page and i thought the volunteer could not see it.
Sorry for that, anyway could fit my code with what i've missed?
Really thanks.
|
|
|
|
|
I fogive to tell i've set a primary key for the database it is for "Nome" column.
|
|
|
|
|
Great! You still need an SQL Update command in your DataAdapter, which your code hasn't supplied.
You have to either write this command yourself or you can check into using an OleDbCommandBuilder[^] object to do it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i use this string to connect on my database
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source= myDatabase.mdb;";
the problem is i consider my database is in the same directory of the main .exe infact at the first time it find the database, but if i call an openDialog form to load some file it moves the current directory path at the path of the file loaded in the openDialog...
So if i try to reconnect at my database it find nomore the source .mdb .
How could i handle this bug?
|
|
|
|
|
Its not a bug, the current working directory has been changed by the file open dialog so the current working directory is no longer that of your application hence you can't see the database.
You need to give the full path to your database. You should be able to get the path of your exe, and then append the database name on to the end of it, so wherever you app is installed it will always work.
Database FAQ
|
|
|
|
|
How can i get the path of my .exe on running?
|
|
|
|
|
ApplicationDirectory.Directory Property
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
How can i use it i'm unable...
i've tryed with:
mPathExe = ApplicationDirectory.Directory;
but it is not correct couse i have to create a class as:
ApplicationDirectory myExe = new ApplicationDirectory(XXXXXXX);
At the place of XXXXXXX i have to give the path of the exe!!! BUT i need to know it before!
|
|
|
|
|
Have a look at the Application.ExecutablePath property.
Database FAQ
|
|
|
|
|
|
The FileDialog class (from which OpenFileDialog is derived) has a RestoreDirectory property that if set to true will direct the dialog to restore the current directory before closing.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Sorry my English.
I`m create
public class MyComponent: System.ComponentModel.Component
{
public From OwnerForm
{
...
}
}
I place MyComponent on some Form
How in MyComponent.OwnerForm i can find MyComponent owner form.
|
|
|
|
|
Hi all
I want transfer images and rtf pdf any data formats from one computer to other.
how can I do this.
and clipboard content from one system to other.
thanks
prabhakar
|
|
|
|
|
prabhakar26 wrote:
want transfer images and rtf pdf
You can use the MemoryStream object..here is a snippet of my code.
MemoryStream _ms = new MemoryStream(aArray);
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf1 =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
_ms.Position = 0;
//before desralizing it write the buffer content to it
_recieved = bf1.Deserialize( _ms );
//once its deseralize call the getobjecttype
//and instantiate the object accordingly
this.GetobjectType( _recieved );
|
|
|
|
|
how can i load data from database to the treeview
|
|
|
|
|
It depends by what datas you have to add
you have to create nodes and add at everyone the data of database but it depend by what datas you have
|
|
|
|
|
Hi all,
I am writing a software that allow dynamic pluging of additional components
(dlls) into the major system by C# on .Net. in runtime.
I want to ask for runtime, can I plug c# classes instead of dll into the main program ? Why I asked this is that I found to dynamic plugging many
small units into the main program, if these units are in form of dll, this
will require long long time to compile in VS.Net(as there are many projects by the dlls).
Or in other view, can I inject c# classes in a dll dynamically in runtime ?
Thanks
|
|
|
|
|
Dear Sir. or Miss,
Now I like to use C# program to modify tnsnames.ora content using
the related methods provided by system lib.
For example, after a client accepts the related values , such as
"zgafc", "109.52.8.8", "1521" and "db.source", then the client can modify (or insert) the file "tnsnames.ora", as following :
ZGAFC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 109.52.8.8)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = db.source)
)
)
then the client can access the db by "zgafc" in client program.
that's to say, if the client just install the oracle client, and do not
config the source in client, however, it can access the appointed database
after the client accept the values related to connection.
If we can find the methods, we can create the database source in client by program, rather than config the datasource in client by manual.
|
|
|
|
|
hi,
i want to know any method to implement #define similar thing in C#. i need to declare some const like below in C++
#define STATUS_A 'a'
currently, i used
public const char STATUS_A = 'a';
or
enum STATUS
{
A = 'a';
}
apart from above methods, any other method?
thanks,
jim
|
|
|
|