|
this is called the smart way of doing
|
|
|
|
|
Hello,
Please I need very urgent solution to this problem. I have an application writing in C# using sql server 2005 express and visual c# 2008 express. I want to connect and insert data to the database from textbox. Onclick on save button I want the data to be submited into database. I dont want to use the manual way of connecting to databse because the db server will not be on my local maching after the completion of the project. I also want to update retrive data from database and update them as well. Am just learning C# on my own and this is beyond my ability at the moment. Please help me.
Waiting for your kind reply
Thanks,
Ademola
|
|
|
|
|
|
Thank you for the link. I'm now stock here
SqlCommand myCommand= new SqlCommand("INSERT INTO table (Column1, Column2) " +
"Values ('string', 1)", myConnection);
The value is given me problem. How do I get the value from textbox before it can be inserted into batabase. I have design my form and i need to get information from user through the textbox whenever they click the save button on the form.
Thanks for your help.
Ademola
|
|
|
|
|
You may also consider storing all the SQL DB connection information in an XML file instead of hardcoding.
|
|
|
|
|
Thanks for you answer pleas how do I do that?
|
|
|
|
|
Use System.Xml.XmlDocument in you code to parse the XML document and extract the database name, connection string and other information and save them into your types objects. Use these type objects normally as you do database interaction and transaction.
|
|
|
|
|
Hi to all.
I am developing an IE toolbar.
Now I need to know if there is any way to identify status of my Toolbar. i.e. Is My toolbar is enable/disable in IE Which event will fire when Toolbar is disable/enable by user.
Please Help Me.
|
|
|
|
|
i have created a windows service using VS2005 and installed it using the installutil.exe. I used the following command to install the service:
installutil /name=MyService /user=<username> /password=<password> <servcieexecutable>
After executing this command I get the output as:
The Commit phase completed successfully.
The transacted install has completed.
But still I can not see the service in services.msc window not Can I see any registry entries for this service. I have admin Privilege on my machine.
Any pointers??
PS: I am using following code to create the service:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Collections;
using System.Configuration;
using System.IO;
namespace TestService
{
public partial class myService : ServiceBase
{
public myService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
FileStream fs = new FileStream(@"c:\temp\mcWindowsService.txt",
FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs);
m_streamWriter.BaseStream.Seek(0, SeekOrigin.End);
m_streamWriter.WriteLine(" mcWindowsService: Service Started \n");
m_streamWriter.Flush();
m_streamWriter.Close();
}
/// <summary>
/// Stop this service.
/// </summary>
protected override void OnStop()
{
FileStream fs = new FileStream(@"c:\temp\mcWindowsService.txt",
FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs);
m_streamWriter.BaseStream.Seek(0, SeekOrigin.End);
m_streamWriter.WriteLine(" mcWindowsService: Service Stopped \n"); m_streamWriter.Flush();
m_streamWriter.Close();
}
}
}
|
|
|
|
|
what it is showing in installLog file??
Also check the Event Log
himanshu
|
|
|
|
|
Install.log says
"Installing assembly 'C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe
logfile = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe assembly.
Committing assembly 'C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe
logfile = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe assembly.
Remove InstallState file because there are no installers.
Installing assembly 'C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe
logfile = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe assembly.
Committing assembly 'C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe
logfile = C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Documents and Settings\sankalp_verma01\My Documents\Visual Studio 2005\Projects\TestService\TestService\bin\Debug\TestService.exe assembly.
Remove InstallState file because there are no installers."
Event viewer says:
Service cannot be started. The service process could not connect to the service controller
|
|
|
|
|
Have you correctly set the properties of ServiceProcessInstaller and ServiceInstaller1 in your installer class ?
himanshu
|
|
|
|
|
I am really new to this service stuff. I have pasted my code along with the main question. Can you please guide me what i could be missing upon?
|
|
|
|
|
|
Most of your message is missing. There are inpout32,dll files on cP, along with instructions. I had no trouble using them in C#.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
antew wrote: please plz plz help its urgent
That's nice and how is that my problem? The bad spelling and urgent just turns most people off.
|
|
|
|
|
Hi
I have XP prof. version 2002 with SP 3 installed.
I try to develop an FTP application but i now unsecure about my "FTP-server"
I have installed Internet Information Services (IIS 5.1) and setup and configured as it should be (i think). This is the problem "I think" !
I dont know in first place, can i have a FTP-site on my machine or must i have another machine with Win Server 2003 or 2008 ?
You see - when i log in with my appl. i get the message "user test cannot log in" ALL the time.
I probably got lost in the user account settings ?
Anyone knows ?
With kind regards
Heino
modified on Thursday, June 11, 2009 5:42 AM
|
|
|
|
|
and this is to do with c# in what way?
|
|
|
|
|
You have any help to give ?
The application is written in C#
|
|
|
|
|
Consult http://learn.iis.net/[^] for information regarding how to setup a secure FTP server and general IIS help. In future you might want to consider posting your questions in the right forum / website so people don't get angry :P
Dave
|
|
|
|
|
Thanks for u answer David !
I will get better next time about the forum
And by the way, this user "hopingToCode" i find him/her very rude.
I seen his/hers answer to other people also.
Any way Thanks again !
Heino
|
|
|
|
|
Hi All,
i need some info regarding c# and vb.net.
which one(c# or vb.net) will be good to kept as front end , back end will be a database for project like school management system or to develop any kind of automation software. i dont know which can be better one to do this kind of project.
Thanks in advance .
|
|
|
|
|
The answer to this question is 6 of one half a dozen of the other! It depends on which skill set you have now and going forward.
|
|
|
|
|
|
It seems that you need to start with your basics as far as the .net technologies are concerned. So I would recommend you to acquire some knowledge before you start your project by buying some good books on .net and referring online materials.
Regards
Saanj
There is no foolish question, there is no final answer...
|
|
|
|