.net

How to inherit constructors with arguments in .NET?

I have a "MustInherit" .NET class which declares a constructor with an integer parameter. However, Visual Studio gives me an error when I create any derived class stating that there is no constructor that can be called without any arguments. Is it possible to inherit the constructor with arguments? Right now, I have to use Public Sub N...

Good example of Reactive Extensions Use

I understand the basics of Rx. Where I'm struggling is how you would actually use this beyond academic examples? What are some common, simple real-world scenarios where Rx is a much better solution than what we have today in .NET? ...

Why isnt HashAlgorithm.Dispose public?

Why isnt HashAlgorithm.Dispose public? void IDisposable.Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } I understand that it is and explicit interface implementation and can still be called. I am trying to work out what the reasoning is behind it. ...

Getting PropertyChangedCallback of a dependency property always - Silverlight

I have a dependency property and a callback. public static readonly DependencyProperty IsBusyProperty = DependencyProperty.Register("IsBusy", typeof(bool), typeof(TabHost), new PropertyMetadata(false, IsBusyPropertyChangedCallback)); private static void IsBusyPropertyChangedCallback(DependencyObject o, ...

What are the essential COM components required for burning DVD in Windows XP using .NET?

I'm trying to burn DVD/CD through frontend C# code... i have used IMAPI2 for buring CD/DVD in windows XP..but it is giving me unhandled exception... as:- System.InvalidCastException: Unable to cast COM object of type 'IMAPI2.Interop.MsftFileSystemImageClass' to interface type 'IMAPI2.Interop.MsftFileSystemImage'. This operation failed...

reset the data in the table of data set in c#.net

im populating the data in the combo box using dataset tables...with some table name..now i want to clear those entries or data populated in the combobox every time when the button is clicked...so that new entries can be done.... is there any way to clear the comobo box values?? ...

Design Patterns Recommendation for Filtering Option

Hi people, I am thinking to create a filter object which filters and delete everything like html tags from a context. But I want it to be independent which means the design pattern I can apply will help me to add more filters in the future without effecting the current codes. I thought Abstract Factory but it seems it ain't gonna work o...

LinQ to objects GroupBy() by object and Sum() by amount

Hello, I have pretty simple case which I started solving using foreach(), but then I thought I could do It using Linq Basically I have IList that contains PaymentTransaction objects and there are 2 properties Dealer and Amount I want to GroupBy() by Dealer and Sum() bv amount. I tried to accomplish this using following code, but unfo...

strange problem with WriteBeginTag

i use such code, but it renders with error <li class="dd0"><div id="dt1"<a href="http://localhost:1675/Category/29-books.aspx"&gt;Books&lt;/a&gt;&lt;/div&gt;&lt;/li&gt; there is no > in opening tag div. what the problem? writer.WriteBeginTag("li"); //writer.WriteAttribute("class", this.CssClass); writer....

Adding database field dynamically into Crystal report in C#

I am trying to add a Database Table field into crystal report at run time. I am creating an object of crystal report viewer and trying to add dynamic field into it. After googling i found that i need to create an object of crystalReports.rpt file, which i was disable to. Refrence that I followed Please Provide me some solution. ...

Why does a float divided by a larger float result in zero, and how can I avoid this in C#?

I was trying to divide (float)200 / (float)500 but the result is 0.0. Why is this so and how can we have 0.4 as the result? Thanks a lot. ...

What does this regex expression do?

Hi All, I am looking after fixing a bug and there I find this expression:- directoryPath = Regex.Replace(directoryPath, "[^\\w\\.@-]", ""); but as a result of the expression all the high ascii characters in directory path are messed up, I am not good at regex and dont know about it but for now I have to fix the issue . Can someone ...

how to get method's dependency diagram

Hi I am trying to find a tool that shows a dependency tree for method calls from an assembly. If the method call chain goes across assemblies, this would also be shown I have looked at dependency walker and Reflector for .Net, these tools show assembly dependencies but I want drill down one more level to get the assembly method call dep...

What sense does asynchronous IO make if the thread is blocked anyway (see example)

Hello, I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), state ); // Block the current thread until all operations ar...

MySql BulkCopy/Insert from DataReader

I am loading a bunch of rows into MySql in C#. In MS Sql I can feed a DataReader to SqlBulkCopy, but the MySqlBulkCopy only presents itself as a bootstrap for a bulk load from file. So, my current solution is using a prepared command in a transacted loop. Is there a faster way to accomplish bulk loading of MySql using a DataReader sour...

OutOfMemoryException, large Private Data

Hello, In previous series: http://stackoverflow.com/questions/2543648/outofmemoryexception-stack-size-is-huge-large-number-of-threads I have a .net windows service that consumes a lot of memory. The GC heap is not big. Also the stack size is not big. What is big is something called a private data. Also I can see in task manager that m...

run .net consolapp out of a cgi script

Hello there, i have written a simple cgi python script which looks like this #!c:/Python25/python.exe -u import cgi import os def main(): print "Content-type: text/html\n" form = cgi.FieldStorage() print form["firstname"].value os.execvp("D:\\path\\to\\my\\consolapp.exe", [""]) main() As you can se i'd like to st...

Is is possible to determine a password input string as plaintext or hashed?

I have a RESTful API containing a URI of /UserService/Register. /UserService/Register takes an XML request such as: <UserRegistrationRequest> <Password>password</Password> <Profile> <User> <UserName>username</UserName> </User> </Profile> </UserRegistrationRequest> I have the following questions given the above sce...

Difference between DataTable.Load() and DataTable = dataSet.Tables[];

Hi All , I have a doubt i use the following piece of code get data from a SQLlite data base and Load it into a data table SQLiteConnection cnn = new SQLiteConnection("Data Source=" + path); cnn.Open(); SQLiteCommand mycommand = new SQLiteCommand(cnn); string sql = "select Company,Phone,Email,Address,City,State,Zip,Country,Fax,Web fr...

Cannot implicitly convert string to text box

I am getting the following failure message when i build on the below two lines http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/eb92ef98ac.jpg Exceptions = message.Substring(trav + 1, expdiff - 1); ExceptionList.Add(Exceptions); ...