Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
QuestionHow to Upload and Display File in C# ASP.Net 2005 Pin
Muhammad Chitrali19-Jun-07 18:03
Muhammad Chitrali19-Jun-07 18:03 
AnswerRe: How to Upload and Display File in C# ASP.Net 2005 Pin
Nouman Bhatti19-Jun-07 20:40
Nouman Bhatti19-Jun-07 20:40 
QuestionHow to write an Array to a file, fast? Pin
gire19-Jun-07 11:57
gire19-Jun-07 11:57 
AnswerRe: How to write an Array to a file, fast? Pin
Luc Pattyn19-Jun-07 12:24
sitebuilderLuc Pattyn19-Jun-07 12:24 
AnswerRe: How to write an Array to a file, fast? Pin
Jon Hulatt20-Jun-07 2:19
Jon Hulatt20-Jun-07 2:19 
GeneralRe: How to write an Array to a file, fast? Pin
gire20-Jun-07 11:05
gire20-Jun-07 11:05 
AnswerRe: How to write an Array to a file, fast? Pin
Hesham Yassin25-Jun-07 1:34
Hesham Yassin25-Jun-07 1:34 
QuestionBindingList over Remoting using an interface types Pin
MBursill19-Jun-07 10:43
MBursill19-Jun-07 10:43 
This works without any problems:
TcpChannel myChannel = new TcpChannel();

ChannelServices.RegisterChannel(myChannel, false);

ICustomer objCustomer = (ICustomer)Activator.GetObject(typeof(ICustomer), "tcp://localhost:8000/Customer.rem");
BindingList<ICustomer> customers = objCustomer.GetCustomers();
My form has a binding source which I set the DataSource property to the customers object. The form also has a Binding Navigator which pulls form the BindingSource.

If I set the AllowNew property on the customers list to true I get the "+" icon on the BindingNavigator. Exactly what I want.

However, when I click that icon it attempts to make a new object of the interface type ICustomer. Obviously not possible.

So, I handle the AddingNew event of the list with this:
void customers_AddingNew(object sender, AddingNewEventArgs e)
{
    ICustomer newCustomer = (ICustomer)Activator.GetObject(typeof(ICustomer), "tcp://localhost:8000/Customer.rem");

    e.NewObject = newCustomer;
}

Sadly, that gives me the error:

"Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed."

I've read up on this err and found that if you change the typeFilterLevel of your remoting formatter it would work. I'd prefer not to do that.

Info on that was found here:
http://www.thinktecture.com/resourcearchive/net-remoting-faq/changes2003

If they changed this behavior in .Net 2.0 than it was probably for a good reason. There has to be another way to do this? Is it not best practice to code towards interface types? What's the solution for dynamic lists over remoting when using interface types? Confused | :confused:

-Mike.
QuestionDelete From registry using C# (like "regedit" ) Pin
Iftekhar Naim19-Jun-07 9:53
Iftekhar Naim19-Jun-07 9:53 
AnswerRe: Delete From registry using C# (like "regedit" ) Pin
Martin#19-Jun-07 10:13
Martin#19-Jun-07 10:13 
GeneralRe: Delete From registry using C# (like "regedit" ) Pin
Iftekhar Naim20-Jun-07 1:18
Iftekhar Naim20-Jun-07 1:18 
GeneralRe: Delete From registry using C# (like "regedit" ) Pin
Martin#20-Jun-07 1:20
Martin#20-Jun-07 1:20 
Questionimage problem xslt to excel Pin
ksrs19-Jun-07 8:06
ksrs19-Jun-07 8:06 
QuestionError building C# control library Pin
Richard Jones19-Jun-07 7:32
Richard Jones19-Jun-07 7:32 
AnswerRe: Error building C# control library Pin
Jon Hulatt19-Jun-07 10:12
Jon Hulatt19-Jun-07 10:12 
GeneralRe: Error building C# control library Pin
Richard Jones20-Jun-07 1:45
Richard Jones20-Jun-07 1:45 
QuestionCurrentTimestamp Pin
LCI19-Jun-07 7:12
LCI19-Jun-07 7:12 
AnswerRe: CurrentTimestamp Pin
Giorgi Dalakishvili19-Jun-07 7:22
mentorGiorgi Dalakishvili19-Jun-07 7:22 
JokeCool signature! Pin
Martin#19-Jun-07 9:29
Martin#19-Jun-07 9:29 
GeneralRe: Cool signature! [modified] Pin
Giorgi Dalakishvili19-Jun-07 10:01
mentorGiorgi Dalakishvili19-Jun-07 10:01 
GeneralRe: CurrentTimestamp Pin
Le centriste20-Jun-07 2:06
Le centriste20-Jun-07 2:06 
GeneralRe: CurrentTimestamp Pin
Giorgi Dalakishvili20-Jun-07 2:49
mentorGiorgi Dalakishvili20-Jun-07 2:49 
QuestionFile Open Status/Access Pin
RussBus19-Jun-07 7:10
RussBus19-Jun-07 7:10 
AnswerRe: File Open Status/Access Pin
Giorgi Dalakishvili19-Jun-07 7:27
mentorGiorgi Dalakishvili19-Jun-07 7:27 
GeneralRe: File Open Status/Access Pin
RussBus19-Jun-07 7:32
RussBus19-Jun-07 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.