|
Does MasterContext implement IDisposable? If not you can't have it in a using
|
|
|
|
|
You must not know anything about Linq to Sql. MasterContext in a Linq to Sql class inherits DataContext which implements IDisposable. Also the documentation for Linq to Sql has almost the first line stating you should always use using() when creating a DataContext.
|
|
|
|
|
You're right, I don't know anything about Linq to SQL
|
|
|
|
|
System.Data.Linq.DataContext implements IDisposable , so MasterContext will too if it subclasses System.Data.Linq.DataContext . Check your inheritance hierarchy (not forgetting partial class files). It is also possible that something has gone wrong in auto-generation, if all else fails, I suggest is a restart (which fixes a surprising number of the odder problems).Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
That was the 'trick'. Everything that was 'broken' last night works today.
|
|
|
|
|
My application behaves unpredictably as I turn on the 'Group similar taskbar buttons' option in the Taskbar properties.
Strangely, the problem occurs only on some computers.
It is as follows:
I enable the Group similar taskbar buttons option in the Taskbar properties. As the taskbar buttons begin to get too small Windows automatically groups buttons so that all of the open buttons from the application are grouped into one taskbar button. This works fine.
The icon of the groupped button is Application's default resource icon which is also OK.
The problem is that the caption of the groupped button is set to the AssemblyName not the AssemblyTitle defined in the AssemblyInfo.cs file.
As I mentioned this problem occurs only under some conditions. I can not determine them.
For example the feature works fine as I run the application from local disk while it does not work as I run the application from network disk (same machine, same application).
Best regards,
David
|
|
|
|
|
I doubt this will really help you much...but are you aware of the fact that .NET applications running from a network share are treated as security risks? Maybe that ties into your issue somehow.
|
|
|
|
|
Hi,
I'm writing a UserControl that has similar functionality to the ListView but I'm writing it from scratch, it has columns and rows of type List<t>;
Everything is generally fine with the project its moving along except when I add items to columns or rows at design time, the IDE seems to be doing something odd when generating code in InitializeComponent().
For instance;
private void InitializeComponent()<br />
{<br />
BigView.Column column1 = new BigView.Column();<br />
this.bigViewer1 = new BigView.BigViewer();<br />
column1.Value = "Key";<br />
column1.Width = 253;<br />
new BigView.ColList().Add(column1);<br />
}
Every time I re-compile the project the columns are not reloaded in the designer, because the code above never really assosciates the column with my user control. I've tried lots of combination of attributes but nothing solves my problem.
This is what I'd expect the code should look like;
private void InitializeComponent()<br />
{<br />
BigView.Column column1 = new BigView.Column();<br />
this.bigViewer1 = new BigView.BigViewer();<br />
column1.Value = "Key";<br />
column1.Width = 253;<br />
this.bigViewer1.Columns.Add(column1);<br />
}
Does anyone know why the designer would do this? Why it creates a column but never adds it to my Columns property?
The columns property is a List<column>. The same thing happens with my rows property which is a List<row>.
|
|
|
|
|
I've solved this. I tried defining several attributes for the property and built the project but nothing seemed to change. After reading this article on [MSDN], section 'Generation of Nested Objects'; "mark a property with DesignerSerializationVisiblity.Content to indicate the code generator should "walk in" to this property and generate code for it" I had set this a while ago but found out I had to re-start visual studio for the changes to take effect?? not sure why I need to restart VS tho, but once I did it worked.
Does anyone know why I have to re-start VS to see changes in the UserControl? I'd have thought a simple 'rebuild' would have refreshed the loaded dll.
|
|
|
|
|
Hi i'm using this
Private _databasefields As New List(Of VerticeBindingField)
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content), MergableProperty(True)> _
Public ReadOnly Property DatabaseFields() As List(Of VerticeBindingField)
Get
Return Me._databasefields
End Get
End Property
Speto!
|
|
|
|
|
This is probably a newbie question so bear with me as I am new to C#/OOL
I'm currently developing a client/server system where what I would like to happen is that the server reads the eventlog whenever the eventlog is updated, stores this info and then updates the console on the client with the new information. So far I've got the eventlog reading working ok but can't work out how to get the server to call a method on the client to update the client console.
I currently have a method on the client (displayInfo()) which if I run every 10 seconds does what I want but I would rather call this from the server as and when the eventlog is updated. I also currently have at least some Remoting functionality through a ClassLibrary as the client needs to read the data from the server.
Additionally - With regards to remoting is a communications channel a 2 way thing i.e once a channel is established can it be used to process data in both directions or can it only be used by a client to retrieve data from a server?
Thanks for your time
|
|
|
|
|
As the server will have no way of knowing what clients are available you will need some mechanism to register the clients with the server. However, depending on your usage and where the clients will reside it may be better to poll the server occasionally. Alternatively, the server could place information is a database which the clients access to display it. Again depending on several factors you may be able to use SQL Dependency to have the client refresh it's view. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: you will need some mechanism to register the clients with the server
That makes sense and makes it far less appealing so based on that I'll switch to periodic polling from the client as it really isn't worth the effort at this point
Thanks for your time
|
|
|
|
|
If clients and server are on the same network, you coluld use WCF with a Duplex Contract.
Otherwise, polling is still the best option.
|
|
|
|
|
Dear All,
I have a problem in performing a operation in an existing excel file containing some operation(take for example add of 2 numbers).
Get input and write in the particular field in excel and automate the operation and get the output and show it in front end..
Pl help me in succeeding in achieving this proj.
|
|
|
|
|
For a complete sample on how to use excel via C#, see here
To use formulas, see here[^].Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Iam Developing a Application where it contains two threads. Now i want to show a single ProgressBar for two different threads. Can any body giude me regarding this... Please
|
|
|
|
|
You must perform the UI update from the UI thread, otherwise an exception will be thrown. This guy has a nice article about threading and winforms:
http://www.yoda.arachsys.com/csharp/threads/winforms.shtml[^]
In WPF, the UI thread can be found on the Dispatcher object.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hello,
i want to let a Silverlight-Application run in a WinForms Application (in the WebBrowser Control or the Silverlight-Control)
How can i make that they both can communicate with each other? I mean, how can my Silverlight Application invoke a method in my WinForms Application and the same in the other direction?
Many thanks
|
|
|
|
|
Your Winforms code would need to talk to the Javascript code that hosts the Silverlight code. This Javascript code will act as the bridge between your Winforms code and the Silverlight application.
If you are calling a Silverlight website via a web browser control, check the website documentation to see if they accept input parameters via their javascript code.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
If we write in the same way as above for the hashtable then we would not get the desired values.
Hashtable ss = new Hashtable();
ss["key1"] ="india";
ss["key2"] = "bharat";
foreach (object gg in ss)
{
Console.WriteLine("Key value is " + gg);
Console.Read();
}
Here we get System.Collections.DictionaryEntry and System.Collections.DictionaryEntry as output instead of the value pairs stored in the hashtable.
In this case we can help of DictinaryEntry object for iterating the hashtable.
foreach(DictionaryEntry gg in ss)
{
Console.WriteLine("Key and value are " + gg.Key + " " + gg.Value);
Console.Read();
}
A DictionaryEntry object is simply a container containing the Key and Value .
http://www.mindfiresolutions.com/How-To-Iterate-the-Hashtable-in-C-311.php[^]Cheers,
Eliza
|
|
|
|
|
Did you post this in the wrong place? Perhaps you meant to post a tip/trick? Or maybe you meant to post this at the bottom of an article? This is a forum for C# questions.
|
|
|
|
|
Nah, I think he just missed and gave us his lecture notes instead of his homework question... You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
The link points to the same thing posted by the OP. I am honestlly baffled.
|
|
|
|
|
Hi,
I have 2 dataset. I am getting values from database and binding same values to dataset1.
This method is written in refresh call so that what ever changes done or update done in the database that will be affected the values to that dataset1. but with the same time i m passing these same values from dataset1 to dataset2.
Now in that I want only those values that changed. Means i want only updated values so that my dataset2 will change accordingly. so by passing every time full dataset1 I want to pass or update only updated information.
Thanks
sjs
|
|
|
|