|
How to update data through datagridview in C#.NET 2005 (ADO.NET) ?? Please help..
NEHA GUPTA
|
|
|
|
|
|
Hi,
I am developing a Windows application using C# 3.0, in that I have to open a pdf document. Using the Adobe PDF Reader com component I am able to open the PDF document, then deployed the application and created the setup. When I install the application in Win XP it's working fine, but when I install the same in Windows 7 or Vista, Adobe PDF Reader com component is throwing error as "Com Class not registered". Even thought I run that exe file as "Run as Administrator", it's throwing the same error.
Any one guide me how to solve this, how to make my application to work in all Windows OS? Please suggest me.
Thanks in Advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Do you get that error on both 32bit and 64bit versions of Win7/Vista, or on 64bit versions only? In the latter case, you could change the target of your application to x86.
|
|
|
|
|
Thanks for your response. I am getting this error message in 64bit OS. Also while deploying my application I tried by setting the Target Platform as x86, but still it's throwing the same error.
Know is Drop, Unknown is Ocean
|
|
|
|
|
I suspect you're hitting an issue where there's a 32 bit version of the COM component registered, but not an appropriate 64 bit compatible version. One way round this, if you don't care about your application using 64 bit features (i.e. memory), is to use corflags.exe to set the CorFlags section in the PE executable. The command you need is
corflags exefilename.exe /32bit+
|
|
|
|
|
How do you create that COM class? Is the registry path hard coded in full length? How did you create the reference to the component ("COM" from the "add reference" dialog, or a PIA)? Perhaps show a few lines of code leading to the line with the error.
|
|
|
|
|
Please tell me...
How to generate(catch) stack trace exception using visaul studio 2008 IDE.
defaulty, try- catch with common Exception only allowed
for example :
try
{
File.OpenRead("NonExistentFile");
}
catch(FileNotFoundException fnfex)
{
Console.WriteLine(fnfex.ToString());
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
Instead of
try
{
File.OpenRead("NonExistentFile");
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
Thanks
|
|
|
|
|
Are you asking about how to get the stack trace when an exception is raised?
See Exception.StackTrace[^] property.
I am a HUMAN. I have that keyword in my name........
_AnsHUMAN_
|
|
|
|
|
I created certificate by executing a batch file, which has the below commands.
cd C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
makecert -ss BBBC
On executing above batch file, its creating "BBBC" folder. It contains a default certificate. I would like to remove the default one by below code. But, I'm not getting any list in "fcollection" variable. Please correct the code to find default certificate in BBBC and remove the same.
X509Store store = new X509Store(StoreName.AuthRoot, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadWrite | OpenFlags.MaxAllowed);
X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "localhost", false);
Console.WriteLine("Number of certificates: {0}{1}", fcollection.Count, Environment.NewLine);
foreach (X509Certificate2 x509 in fcollection)
{
byte[] rawdata = x509.RawData;
Console.WriteLine("Friendly Name: {0}{1}", x509.FriendlyName, Environment.NewLine);
Console.WriteLine("Simple Name: {0}{1}", x509.GetNameInfo(X509NameType.SimpleName, true), Environment.NewLine);
store.Remove(x509);
Console.WriteLine("X509Certificate2 for localhost removed.");
}
store.Close();
|
|
|
|
|
I just correct the below statements. Its worked. Thanks..
X509Store store = new X509Store("BBBC");
X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectDistinguishedName, "CN=Joe's-Software-Emporium", false);
|
|
|
|
|
I am recently curious about the process of writing your own toolbox controls. Let's take a basic approach and say I wanted to write a textbox control that was always multi-line with both scrollbars. I want to have all the events, properties and such.
How do you wire up events so that when you drag the textbox onto the form and double-click it the IDE goes to the correct handler or default handler like in the case of a button it's the Button_Click. How do I make my own button control and when I double-click it in the IDE have it go instead to Button_MouseDown or something else entirely? How do you add events for the IDE and design time?
I'd google this I just don't know what search terms to use. I've tried and failed.
|
|
|
|
|
code-frog wrote: How do you wire up events so that when you drag the textbox onto the form and double-click it the IDE goes to the correct handler or default handler like in the case of a button it's the Button_Click.
If your control is derived from Button control, this should be happening automatically.
code-frog wrote: How do I make my own button control and when I double-click it in the IDE have it go instead to Button_MouseDown or something else entirely?
If I remember correctly, DefaultEventAttribute[^] should do the trick.
code-frog wrote: How do you add events for the IDE and design time?
IDE should show up any public events that your control provides without doing anything special.
Best wishes,
Navaneeth
|
|
|
|
|
Hi
I am building an application in C# which needs to take direction from a Delphi app.
I am having quite a time adding a socket connection to the C# app using Net.Sockets.
I've searched copiously, but all examples I have found are for standalone socket connections.
Could someone point me to an example app that includes a socket connection to recieve infomation.
I am looking at a socket connection as I don't want to block the operation of the app waiting for a connection.
Bob
|
|
|
|
|
Bob Pawley wrote: I am looking at a socket connection as I don't want to block the operation of the app waiting for a connection.
A socket connection has nothing to do here. If you don't want to block the operation of the application, you need to run the processing on a background thread.
Bob Pawley wrote: I've searched copiously, but all examples I have found are for standalone socket connections.
Could someone point me to an example app that includes a socket connection to recieve infomation.
What do you meant by standalone socket connection? This[^] article is a good read on the subject.
Best wishes,
Navaneeth
|
|
|
|
|
* I have no knowledge of Delphi.
If the Delphi app is on the same machine as the C# app, you should use named pipes.
Named pipes is a method communication between processes without claiming a network socket.
Claiming a network socket when it is unnecessary is bad practice for it might block access for other applications.
Named pipes in C# @ MSDN[^]
|
|
|
|
|
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("wellcome to");
Console.Write(" " + args[0]);
Console.WriteLine(" " + args[1]);
|
|
|
|
|
And what's your question? BTW - it's bad practice to use arguments without testing to see if they are null, or if you've gone past the end of the array. There are these nasty things called Exceptions which end up taking you outside and whacking you with baseball bats.
|
|
|
|
|
If you want to keep the compiler happy you should watch the balance of symbols that come in pairs, such as { and }.
And if you want help around here, you'd better read the "how to get an answer" message on this page. Showing exact symptoms (compiler errors, run-time exceptions,...) is essential. Putting code snippets in PRE tags is highly recommended too.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Pete and Luc both raise valid points.
How to fix them:
1) When you post a code fragment, use the "code block" widget to put <pre> and </pre> tags around it: this preserves the indentation and formatting and makes it a lot easier to read!
2) As Luc said, you do need to balance all "matched pairs": every '(' must have it's ')', every '{' must have it's '}', and so on:
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("wellcome to");
Console.Write(" " + args[0]);
Console.WriteLine(" " + args[1]);
}
}
} Your program should now compile cleanly.
3) You also need (as Pete said) to check your inputs: what if you didn't provide any command line parameters?
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
if (args.Length >= 2)
{
Console.Write("wellcome to");
Console.Write(" " + args[0]);
Console.WriteLine(" " + args[1]);
}
else
{
Console.WriteLine("Usage: ConsoleApplication1 YourName");
}
}
}
}
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Hi All,
Does anyone know how to move/copy an email from one folder to another in C#?
Thank you,
Melanie
|
|
|
|
|
In Outlook? In Exchange? In Thunderbird?
|
|
|
|
|
Thank you for your quick reply, sorry about the lack of info.
It's an Exchange email account that I'm processing emails from using SmtPop.
http://csharpopensource.com/smtpopdotnet.aspx[^]
However, certain emails I'm wanting to copy to a seperate folder.
Thanks,
Mel
|
|
|
|
|
Mel, you can accomplish this using the Exchange Web Services. The method you want is MoveItem[^].
|
|
|
|
|
Pete,
Great, thank you I'll give that a go and let you know how it goes.
Mel
|
|
|
|