|
i want to create a dynamic collection / array of string or any
other object type and by that avoid casting.
how can i do that?
-- Directly From Zion --
------ Haimon15 ------
|
|
|
|
|
haimon15 wrote:
i want to create a dynamic collection / array of string or any
other object type and by that avoid casting.
I have written an addin for vs.net 2003, you can look at:
http://www.thecodeproject.com/csharp/CollectionBuilderAddin.asp
It uses a template that is available in the .NET Magic library. If you find this helpfull you can vote for it on the addin competion:
http://www.thecodeproject.com/script/survey/survey.asp?survey=297
Be sure to look at the other addins as well, besides mine, my favourites are LineCounter and Code Store.
Cheers
ES
|
|
|
|
|
I'm using a datagrid to display information from a dataset.
I added a "delete button" and wish to delete the selected cell in the datagrid. But I have the following problems..
1.- If I rearrange the rows by clicking on the column header of the datagrid, I can no longer find the correct row corresponding to the database using the currentcell.row #.. the currentcell.row would say something like it's row #3 which does not correspond to row #3 in the dataset since I rearranged the rows in the datagrid.
2.- I cannot either manually look for the corresponding row in the database using the currentcell info, because when I displayed the information on the datagrid I ommited the primary key.. So I cannot retrieve this primary key from the currentcell..
Does anyone know of a workaround or a way to actually save the dataset row object with each row of the datagrid??
As always I thank you for any help!!
|
|
|
|
|
Current row in DataGrid (from WinForm) is a row number from DataView, not from DataTable. You can get DataView object from DataGrid object protected(!) property:
(DataView)(myDataGrid.ListManager.List)
Hi,
AW
|
|
|
|
|
Hello,
In my application, I am trying to find the duration of a video clip (IWMPMedia interface) that I loaded into a Playlist object. However, the duration attribute is not defined. If I load an .mp3 (as the WMSDK (version 9) C# example does), the duration element is defined. Is this a limitation of the windows media SDK, or is there something else I need to do?
Thanks,
Brad
|
|
|
|
|
For anyone interest, a temporary solution is to use the AudioVideoPlayback component of managed directx. All you have to to is make a new instance of a Video and examine the duration property for the time in seconds.
|
|
|
|
|
Hello All,
I would like to create an assembly which will pickup a list of (10) printer info. and then install those (10) printers into a server. This server has one purpose -- printers. I will have the IP addresses, the ports, (maybe permissions- roles, users etc.), and the printer names. Additionally , I am going to install the printer driver.
What .NET Framework objects will I need to do this?
I am not a systems guy, so I am not sure if there is more than one scenerio for setting up the operating system . I am hoping it will be an "Active Directory" environment. If you are knowledgeable about these options I would also appreciate it if you could tell me what are the environment options.
Any bits of code in C# which show me the ,(.NET Framework Objects), "objects of my desire" would be great!!
Thank You in advance for Your Help
Ken
|
|
|
|
|
any one here know how the Microsoft update site animates the files/downloads when the user clicks on it?
|
|
|
|
|
hello,
sorry if this is asked somewhere, I have looked but didn.t find exactly what I was looking for.
I am looking for a simple/sample script of connecting to a pop server via C# from a web page.
I can find many examples of connecting via a "application", but not from a web form. Any links to articles/samples would be very much appreciated. Thanks again
CS
|
|
|
|
|
Take a look under the ASP.NET articles[^] General section, I believe I have seen a few articles in there covering something like this.
-Nick Parker
|
|
|
|
|
I am writing a logistics application suite. It will have a main program, a maintenance program, an order entry program, and an admin program. The main program will just control security while all other applications are running. Whenever any of the other programs start up, first it is going to check if there is already an instance of the application running using System.Diagnostics.Process.GetProcessesByName(). If there is then it will just activate that instance. If there isn't then it will then check if there is an instance of the main application using System.Diagnostics.Process.GetProcessesByName(). If there is an instance of the main application, then it will just get a reference to the user object from the main program. If there isn't an instance of the main application, then it will create a new process of the main application with System.Diagnostics.Process.Start(), which will require the user to log in and that will intialize the user object. Then the executing program will get a reference to the user object from the main program that was just started. I hope this explains everything I am trying to do. If you have any suggestions on how to do this or of a better way to reach the desired outcome, I would greatly appreciate it. Thanks
Shaun
|
|
|
|
|
Since it is different applications using different AppDomains, you will probably want to go with a remoting singleton object. That would allow you to share the single instance between the applications.
You could spin off an invisible WinApp UserData server module that will host your remote object. The UserData object could have a reference counter property to track how many client connections it currently has. When an application starts, if the UserData server is not in the proccess list, then it would start the UserData server, and call the UserData member to display and validate the login. Of course, if the server is already running then it does not do the login since the login has already occured and the UserData object will have your login instance.
After the server is confirmed to be running, the program that was launched would remote connect to the UserData object and increment the ref count. When a application is closing, it decay the ref counter by one and if it is zero, it would trigger the UserData server to close.
Rocky Moore <><
|
|
|
|
|
Do you have a code example of what you are talking about, because I am not quite sure how to implement what you are talking about? Thanks
|
|
|
|
|
Yeah, I can through together a little sample for you tonight. Just heading to bed at the moment, but will e-mail it to you later tonight.
Rocky Moore <><
|
|
|
|
|
Thank you very much, it worked perfectly. I really appreciate your help.
Shaun
|
|
|
|
|
Your welcome, glad I could be of help!
Rocky Moore <><
|
|
|
|
|
hi,
i think this question has been asked many times in the past, so sorry, but i didnt find any "good"/"acceptable" solution for the mailing thing...
you'd really help me if you have a idea how to
- send emails (including all the stuff, like html-mail, attachments, priority what ever) AND
- receive emails (incl. attachments, etc.)
using VC#
and please dont give the "system.web.mail"-namespace answer ...
code/links to code/example projects are welcome!
hope you can help me on that, thx,
Harry
|
|
|
|
|
Search CP. There is a C# article on Html mail, and a couple on SMTP (send). If I remember correctly there are a couple on POP3 (receive). They should be easy to find.
Rocky Moore <><
|
|
|
|
|
This is what you need to be able to send an email through a C# windows app. You do have to declare using system.web.mail;
MailMessage EmailMessage = new MailMessage();
EmailMessage.From = "someaddress@whatever.com";
EmailMessage.To = "someaddress@whatever.com";
EmailMessage.Cc = "someaddress@whatever.com";
EmailMessage.Bcc = "someaddress@whatever.com";
EmailMessage.Subject = "Subject text goes here.";
string sEmailMessage = "Ask and you shall receive. " + DateTime.Now.ToLongDateString() + " - " + DateTime.Now.ToLongTimeString();
EmailMessage.Body = sEmailMessage;
EmailMessage.Attachments.Add( new MailAttachment( /*string from a openfiledialog file path*/, MailEncoding.Base64 ) );
SmtpMail.Send( EmailMessage );
Hope this helps.
|
|
|
|
|
well, thx, but i already knew that....;)
i know this is cool and easy code for sending, but i need to receive emails aswell!!
and i have no damn clue to do that... i mean receiving emails with attachement and all..
has anybody yet programmed such kind of a class or app?! please i really need that code...
can anyone help!?
|
|
|
|
|
In Windows XP Home Edition, when trying to list MSDE servers using C# and SQLDMO the list is empty. For instance, when doing
SQLDMO.ApplicationClass DMOApp= new SQLDMO.ApplicationClass();
SQLDMO.NameList names=DMOApp.ListAvailableSQLServers();
I get names.Count=0, although two instances of the MSDE server are installed.
Can anybody help?
|
|
|
|
|
|
That is not true. You can add a reference to the Microsoft SQLDMO Object Library 8.0 in the COM tab of the Add Reference dialog in Visual Studio when you have MSDE installed.
As an exemple, see this Christian Graus article.
http://www.codeproject.com/cs/database/MSDE-GUI.asp[^]
|
|
|
|
|
I wish that people would not reply if they are not 100% sure.
I was just reading a book about that and also people have
made apps that lets people administer these MSDE applications
thru the SQLDMO library.
|
|
|
|
|