|
You cannot load 32-bit DLLs in a 64-bit process.
If you want to run your .NET program on a 64-bit machine but cannot provide 64-bit versions of native DLLs it uses, you should force it to run in a 32-bit process. (You will obviously lose the address-space benefits of running in a 64-bit process.) To do this, change the Platform Target property on the Build tab of Project Properties from 'Any CPU' (the default) to 'x86'.
You may want to consider generating a separate configuration for your project. Go to Build, Configuration Manager and in the Active Solution Platform drop-list, select <New...>. Then select 'x86' from the 'select new platform' drop-list and click OK.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
in vb we have keyword as call that call a method , Is there any in c# that do work like this.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
To call a method, just specify it's name. I don't understand what you're talking about.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
let i have method test in code behind file
public void test()
{
// some code
}
i have one string varibale strMethodname ;
now i want to excute test method from this vaiable name;
i.e
public void mentodname(methodname)
{
//methodname = "test()"
strMethodname = methodname;
// i ahve to write some code so that i can execute test() function from strMethodname
// in vb we can write like this call(strMethodname)
// but waht in c#
}
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
That would be reflection.
object res = MyObj.GetType().GetMethod("MethodName").Invoke(MyObj,new object[] {arg1,arg2 etc});
|
|
|
|
|
Thanks that work fine
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
In C# no need to use that. What are you trying to do ?
|
|
|
|
|
I have a generic class "A" another generic interface "IInterface". I also have a derived class from "A". See the following code
class A<T>
{
public void Save()
{
IInterface interface = (IInterface)new InterfaceImpl();
interface.Save((T)this);
}
}
class Derived : A<Derived>
{
}
class InterfaceImpl : IInterface<Derived>
{
public void Save(Derived instance)
{
}
} As shown in the example, I need to call Save() method written inside the InterfaceImpl class. Is there any other way to do this without casting base class object to child class ? Is there any performance problem when base class object is casted into child class object ?
|
|
|
|
|
how to draw progress bar in "orbit" download in file bottom
thanks
|
|
|
|
|
Where do you want to draw it ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
can i start and stop the sql server programaticaly ?
Reason is , i have to take the backup of the database , at regular intervals. Which can't be done without stopping the service manager.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
|
My database is sql server and front end is asp.net 2.0 c#
May i use the window or web service in this case ?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
SQL server has a windows service running. You need to Stop/Start that. The Service controller class gives access to the services installed on machine. What is the problem you are facing now ?
|
|
|
|
|
I want to start/stop the Sql server service manager programatically
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hello,
By using "System.ServiceProcess" you can start and stop a service:
Like:
public static void StopService(string servicename)
{
ServiceController actService = FindServiceByName(servicename);
if(actService!=null)
{
actService.Stop();
actService.Dispose();
}
}
All the best,
Martin
|
|
|
|
|
what parameter should i write , if i have to stop the sql server service manager
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
You use the stop method as given by martin above and to start you use the start method.
(These won't work under Vista by the way, unless you elevate your app to Administrator using an Application Manifest File.)
Dave
|
|
|
|
|
i created the window app there i was trying to write the system.serviceprocess
i was unable to to write there , the library was tot emerging.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
You need to add a reference in your project references to System.ServiceProcess and then add using System.ServiceProcess; at the top of the class.
Dave
|
|
|
|
|
ServiceController actService = FindServiceByName(servicename);
and there is a problem in FindServiceByName funciton
what should i add for this function ?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sorry, forgot that one!
Something like that:
public static ServiceController FindServiceByName(string servicename)
{
ServiceController actService = null;
ServiceController[] services;
services = ServiceController.GetServices();
for(int i = 0; i < services.Length; i++)
{
if(services[i].ServiceName.Equals(servicename))
{
actService = services[i];
}
else
{
services[i].Dispose();
}
}
return actService;
}
All the best,
Martin
|
|
|
|
|
Thank You....
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hello,
You are wellcome!
But let me say, that I'm sure you would have finished this task much faster by using google.
All the best,
Martin
|
|
|
|
|
Sonia Gupta wrote: Reason is , i have to take the backup of the database , at regular intervals.
You should be using SQL Server's built-in backup facilities rather than trying to back up the data and log files as files. Use SQL Agent to schedule backups of the database and (if applicable) transaction logs.
Many backup products (e.g. Backup Exec) include support for backing up SQL Server through SQL Server's backup API.
If you're running SQL Server 2005 on Windows Server 2003, backups of the files through Volume Shadow Copy services are possible. However, you should prefer to use SQL Server's own backup facilities where possible.
If you want to perform a backup under programmatic control, rather than scheduling a job, you can use the BACKUP DATABASE command.
If you don't fully understand the transaction log, you should set the database to use the Simple recovery model. This will allow you only to restore the last full backup - any operations performed after the backup was started will be lost. If you leave it using the Full or Bulk-Logged recovery models, after performing a full backup through the SQL Server API, the transaction log will retain records of all operations performed in order to allow recovery to the point of failure.
These records are only cleared when the transaction log is backed up through SQL Server's backup API or the BACKUP LOG command. The log is not cleared after performing a full backup. Typically this means that the log file will keep growing, depending on the log growth configuration. If the log cannot grow any more due to hitting the limit configured, having autogrow disabled, or running out of disk space, the server will fail the operation.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|