|
You want to export an sql table? If so load it all to a table and write to a csv file, you can find examples of this anywhere on the web.
|
|
|
|
|
I have a C# program which does COM interop to a VB6 DLL via late-binding. The VB6 DLL then uses a 3rd party OCX to generate an image, the file path of which is passed back to my C# program so that it can display the image. This was all working just fine until I moved the C# program from .NET 1.1 up to .NET 2.0. Now, instead of using the program directory's version of the OCX, the COM DLL is using a version in the system32 directory which is causing problems. I can't for the life of me figure out why this is happening. I've played around with App.config files and done a few other things, but nothing is working. I don't know how to tell my C# program to use a COM OCX from a specific file location, especially when the file is not even directly referenced in the program. Again, if I compile it against .NET 1.1 it works fine, but with .NET 2.0 it breaks. Any ideas? This is really driving me crazy. Thanks in advance.
Here's an example of the late-binding code to the COM DLL:
Type myObjectType = Type.GetTypeFromProgID("MyComDLL.ClassToUse", true);
object myObject = Activator.CreateInstance(myObjectType);
myObjectType.InvokeMember("Load", BindingFlags.InvokeMethod, null, myObject, null);
|
|
|
|
|
Greetings,
Now I have my C# socket server running which accepts PowerShell input from a perl socket client running on Linux and sends reply back. I have read through and tried all the sample code on all the websites. But there seems to be a prolem with all of them (and mine). Whenever I invoke "get-acl" command from the client perl program I get this reply from the server: System.Security.AccessControl.DirectorySecurity instead of: the normal output that I see on the Powershell prompt.
But when I run the get-command at the same prompt I get the desired output.
Am I missing something here? Does this mean that getting the functionality of Powershell through this is not possbile? Has anyone tried this ?
Any help will be greatly appreciated.
Best Regards,
sk
|
|
|
|
|
A website is usually running under a restricted user-account. When you run it from the desktop, you're running under the account that you logged into.
I'm not using webservers much, at this point I'd seek out the admin and ask him. Anyway, there are more readers/posters on this thread, maybe someone can explain it better, so that I can learn from it too
I are troll
|
|
|
|
|
Thanks for the reply, hopefully someone has worked on this before. Anyone?
|
|
|
|
|
Again, the ASPNET account that your website is running under has very limited permissions to the system, for obvious security reasons.
You have to change the account that your web site is running under to another account that has the permissions you need to do what you want. This is normally done in IIS Manager.
|
|
|
|
|
Thanks for the tips Dave, but I am running a C# Socket server, asp.net and IIS are not involved in this application. My c# socket server listens on a port listens for a TcpClient, creates a NetworkStream, GetBytes from the client, covert those bytes to string, passes that string to RunShell method which executes that string as a power shell command, coverts that string to bytes, sends it off to the client.
The problem is that all the "string" commands executed by the powershell method are not executed the way they are on a regular powershell prompt. for example get-command works fine but get-alias does:
get-alias on regular powershell prompt:
CommandType Name Definition
----------- ---- ----------
Alias ac Add-Content
Alias asnp Add-PSSnapin
Alias clc Clear-Content
get-alias from my c# prompt:
Sending parameters: 'get-alias'...<done
Welcome to power shell server ...
ac
asnp
clc
cli
-----------
Any ideas?
Best Regards,
sk
|
|
|
|
|
In that case, I have no idea since I've never used PowerShell. Sorry...
|
|
|
|
|
|
Hi All,
Crazy question but it just popped into my head I Google hasn't returned anything so far. How many interfaces can a class implement?
Obviously from a coding standards POV it's going to only ever be a handful at most but is there an absolute maximum number that can be implemented before the compiler complains?
Cheers,
|
|
|
|
|
There are no hard and fast interface limits. Obviously, the more interfaces your class implements, the more likely that you're entangling concerns that could be better implemented elsewhere.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
For sure. I was just writing a tech spec at work and was talking about the pros/cons of interfaces vs abstract classes and the question just popped into my head.
I don't think I've personally ever strayed past 2-3 yet (including IDisposable type interfaces).
|
|
|
|
|
There is no documented limit. Though, it would probably be capped by available memory at compile time. Depending on the number of things the class has to implement and the amount of code hanging off of it, this could be a few (MASSIVE) interfaces, or it could end up being millions of small ones.
|
|
|
|
|
Indeed. I've got a couple of MASSIVE interfaces (10+ 'things') but they're in a composite application using DI.
Eeek, even the thought of "millions of interfaces" fills me with dread. ;D
|
|
|
|
|
hello people all around the globe!
I would like some help from your side, I want to display a 3d graph similar like the one in excel in a C# desktop application. The data I will get from sql query and then display in a 3d graph.
Any advice? Thanks, Laziale
|
|
|
|
|
|
Hello..Experts,
i am working with inbuilt crystal report2005 in c#.I have problem in displaying records.m designing receipt for product.but my products not displaying one after other serially.it takes separate receipt for each product.
I want it on single page.Please help me
|
|
|
|
|
You are to create a Windows application that contains a single form. The form will have three controls, a textbox, a button displaying the text “Parse” and a suitable UI control, preferably scrollable, used to display the results. After entering the text and clicking the Parse button, the program should output the number of times each letter in the alphabet occurs in the textbox. Case sensitivity is not required.
For example, if the user enters “baaad” as the text and hits the Parse Button, the result control should display:
There are 3 A's
There are 1 B's
There are 0 C's
There are 1 D's
There are 0 E's
There are 0 F's
etc...
This my my homework assignment.. Lol First let me say that im Lost!!!!!
I think i figured out how to get the correct count out of the text ive entered in the first textbox... But i dont know how to get it to correctly display "There are 3 A's" etc... in the result control...
Thank You in Advance
|
|
|
|
|
If you're struggling with this .. you need to find another course to do. This isn't a homework help board! Give it a try yourself and ask spefic questions but to give you a hint have a look at listbox and how to clear and add items!
|
|
|
|
|
Chris Maunder wrote: For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
If you are posting source code with your question, place it inside <pre></pre> tags, or click the "Ignore HTML tags in this message" check box.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
Need any more help?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I think it's cool that he's explicit about it being homework, and that we give some general pointers. We obviously should not give him copy and paste code.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Well, we don't want to do your homework for you. You can use foreach to step over the characters in a string, and then you can count characters from there. I would use a dictionary that maps characters to numbers to do that.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Ok, this is homework, so I'll give you no code example!
for each character (c) in the string increment a count in an array of 26 integers depending on which letter of the alphabet it is.
Then go around a loop 26 times, writing "there are {n} {c}'s" where {n} is the integer from the array, and {c} is the letter.
Write these into a text box which will accept multiple lines, and you are done.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
First lemme preface this by saying im new to the whole forum thing so i apologize if i didnt present this in a correct manner...
and secondly im not trying to weasel my way out of an assignment i really want to learn visual C#... i just have a project due today that for family reasons im just finishing up...
So if i had to ask 1 question:
From inside my button function how do i get multiple lines of text to show in a textbox......
because if i do multiple lines of "textbox1.text =" it'll just keep changing its contents
|
|
|
|
|
textbox1.Text += (Environment.NewLine + myNewLineOfText);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|