I've a dgv on my main form, there is a button that opens up another form to insert some data into the datasource bounded to the dgv. I want when child form closes the dgv auto refresh. I tried to add this in child form closing event, but it doesn't refresh:
private void frmNew_FormClosing(object sender, FormClosingEventArgs e)
{...
In a C# application, I'm creating a signature using DSACryptoServiceProvider. If the user executing the apllication has a temporary profile, I get an exception: CryptographicException: "The profile for the user is a temporary profile."
The failure can be solved if I set DSACryptoServiceProvider.UseMachineKeyStore = true;
But I first wan...
I don't need this declaration because it only makes my code big and unreadable.
Is there a way to make Visual Studio (VS) not add it automatically. Every time I remove it, it is added back by VS.
Function DoStuff(Tom As String)
NOT
Function DoStuff(ByVal Tom As String)
...
Is there a .NET-accessible (i.e. .NET or COM) library that I can use to programmatically control Firefox? I'm looking for something that is a bit like ShDocVw.dll for IE. Doesn't have to do all that much, basically all I want to be able to do is programmatically add a bookmark.
...
Are there any ways, besides throwing exceptions, that one can go about using the partial validation methods in LINQ to SQL to cancel the insert of a record?
...
I am writing my school schedule 'parser' to get it from xls to relational database (SQL Server) trough my website.
I know how to get data from uploaded xls file but the problem is that some classes cells are merged for couple of groups in a row. Problem is xls saves info about merged cell in document styles.
example :
Is there a way ...
I have 10 labels named lbl1, lbl2, ... lbl10
I'd like to change their propriety (using a cicle) with the cicle index
for i as integer=1 to 10 step 1
lbl (i) = PROPRETY 'I know this is wrong but it's what I would do...
end for
I'm using a workaround, but I'm looking for a better way..
Dim exm(10) As Label
exm(1)=lbl1
...
What's the equivalence of vb6.0 frame control in .Net? panel or groupbox?
I recall that using frame in vb6.0 and disable it (frame1.Enabled = False) did not change its fore color of controls within it .
...
What I need is a collection where i can specify the max number of elements. If i try to insert an element and the collection is full. The first element in the collection is removed, so that it does not overflow.
Is there such an object in .net or do i have to make it myself?
...
Hi guys,
I am new to stackoverflow (my first post) and regex.
Currently i am working on a simple dirty app to replace baseclass properties with ctor injected fields. (cos i need to edit about 400 files)
It should find this:
ClassName(WiredObjectRegistry registry) : base(registry)
{
and replace with:
ClassName(IDependency paramName,...
LINQ2Xml:
I would like to get the count of elements where candidate has won in every province. I need some help.
<Pronvice_Data>
<Pronvice>PronviceA</Pronvice>
<Registered_Voters>115852</Registered_Voters>
<Sam_Kea>100</Sam_Kea>
<Jeje>500</Jeje>
<John_Doe>400</John_Doe>
</Pronvice_Data>
<Pronvice_Data>
<Pronvice...
I added 3 tree views in my master page, i want them to show them based on different conditions, but they are not visible on other pages.
Code:
Dim TreeView1 As System.Web.UI.WebControls.TreeView = New TreeView
Dim TreeView2 As System.Web.UI.WebControls.TreeView = New TreeView
Dim TreeView3 As System.Web.UI.WebControls.TreeV...
I'm building a simple client-server chat system.
The clients send data to the server and the server resends the data to all the other clients. I'm using the TcpListener and Network stream classes to send the data between the client and the server.
The fields I need to send are, for example: name, text, timestamp, etc. I separate them u...
How to get the date of a specific week in a specific year?
For example: I have the data week 30, year 2009 - how I can get the date of the week?
Language is C#
...
I have included following webservice in my project
http://www.webservicex.net/CurrencyConvertor.asmx
There i got a function as
ConversionRate() which takes parameters as follws
double Rate;
CurrencyConvertor ccs = new CurrencyConvertor();
Rate= ccs.ConversionRate(Currency.USD, Currency.INR);
lblResult.text=Rate.toString();
It works...
I am trying to do this:
List<Parent> test = new List<Child>();
The complete code of my class is this:
class Program
{
public static void Main(string[] args)
{
List<Parent> test = new List<Child>();
test.Add(new Child());
test.Add(new AnotherChild());
}
}
class Parent { }
class Child : Parent { ...
I'm writing a utility program with C# in WPF that allows users to create role-playing scenarios, including monsters, items, characters, etc.
The user will create or import the elements (monsters, etc) and then use the imported elements to create scenarios. Everything used by the program is created within the program, so I don't have an...
Good afternoon,
I am currently starting to think & prototype about a (.net based) new project which will use MEF extensively and one part will be to plug in new 'storage' types besides a normal file/directory storage (e.g. using scms (clearcase, perforce etc), SAP EDM for long term archiving, OpenText LiveLink etc). Now all of them have...
I'm building a C# class library, and using the beta 2 of Visual Web Developer/Visual C# 2010. I'm trying to save information about what version of .NET the library was built under. In the past, I was able to use this:
// What version of .net was it built under?
#if NET_1_0
public const string NETFrameworkVersion = ".NET 1.0";
...
This could save me so much time. Sometimes I find myself writing things like this in the watch or immediate window:
MyObject.Function1.Fuction2.Fuction3.Fuction2
Instead I could just declare several new variables and do this in a more structured way.
However doing this is not allowed.
Is there some way that i can do this? Is there...