.net

How to convert XmlTextWriter to string?

I am new to XSLT Transformation world. I'm using XSLT to create an HTML file. How can I get the output as string, so that I can save it to an HTML file? Performing the transformation using below line: objXtrans.Transform(objDoc, objArgLists, objXmlTxtWriter); How can I convert objXmlTxtWriter to get the complete string generated via...

.Net Chat Application

hi techies, i am developing chat application using vb.net and asp.net where i am having a div tag inside which i am displaying the messages posted by the online users what my problem is when the messages are more and exceeds the height of the div tag then i am not comfortable to view the previous messages because i have set the scroll ...

How to run a sql script using C#

I have a sql script to create a new database which i need to create when our product is installed. For this i need to fire the script using c#. DB is sql-server 2005 express. Plz help.... The sql script is as follows: USE [master] GO /****** Object: Database [Jai] Script Date: 02/12/2010 11:01:25 ******/ CREATE DATABASE [Jai] ON P...

Determine who/what called Set Property

I am trying to determine what control called a Set property. Say textbox Pet is bound to a Property. I am using INotifyPropertyChanged but I am wondering if there is a way to get the actual control. The sender in my PropertyChanged Event is the Class containing the properties and not the control that originally kicked of the chain of ...

Consume webservice from a .NET DLL - app.config problem

Hi, I'm building a DLL, let's call it mydll.dll, and in it I sometimes need to call methods from webservice, myservice. mydll.dll is built using C# and .NET 3.5. To consume myservice from mydll I've Added A Service in Visual Studio 2008, which is more or less the same as using svcutil.exe. Doing so creates a class I can create, and add...

FlagsAttribute what for?

What is the difference between the code bellow ' no Flags' Public Enum MyEnum Monday = 1 Tuesday = 2 Wednesday = 4 Thursday = 8 End Enum and <Flags()> _ Public Enum MyEnum Monday = 1 Tuesday = 2 Wednesday = 4 Thursday = 8 End Enum I do the Dim days As MyEnum = MyEnum.Monday Or MyEnum.Tuesday Or MyEnum.Wednesday ...

Winforms Databinding with a ViewModel

I have a list of classes that represent mydatabase tables for example Address,Client. My GUI tends to be a grid of data and an data entry form. This works fine for single table data entry however I now have a form that has client information and their address. I was thinking of using a ViewModel combining the Address and Client class ...

Can't find control in code in super class

I have a number of pages <%@ Page Language="C#" AutoEventWireup="True" CodeBehind="MyPage.aspx.cs" Inherits="MyPage " MasterPageFile="~/Site.master" %> <asp:Content ContentPlaceHolderID="commonForm" runat="server"> <asp:Table runat="server"> <asp:TableRow> <asp:TableCell ID="cellControl" /> </asp:TableRow> </asp:Table> </asp:C...

how to call a javascript method after action or from a view?

i just want to be able to call a javascritp subroutine on the client, after the server has done its thing (when an action completes or control goes to the view, i'd dont mind calling the js from the view either). for some reason, even vs2010 doesn't let me put breakpoints in <% ... %> tagged areas between <script...> and </script> tagg...

Should Unit Tests be in their own project in a .Net Solution

Should I start a new project for my unit tests? That would mean that I would get two executables correct? Then I am worried about the namespace organization. Would I be able to put the unit test in the same namespaces as the classes that they are testing although they are part of a different project? This raises another question. I know...

Referencing Assemblies Outside GAC Without Fixing the Path

Hi there, I'm currently in the process of researching the best development and deployment practices for our team. We have a load of similar code that we're going to start importing into a library of shared assemblies for use across our suite of (web & win) applications. I'm starting to get a clear idea of where I think we should be he...

TweetSharp get followers count

Does anyone know how to use TweetSharp to get some account's follower count? ...

Why does an instance of a generic class get altered on a separate thread when an instance of an ordinary class does not?

Hi, When an object is altered in a method that runs on a separate thread, the object is not altered on the calling thread (the thread that started the thread on which the method runs). However, if the class that defines the object is generic, the object gets altered on the calling thread. For example: I have two classes: public class...

.net regasm question

Lets say we have this scenario a setup that deploys a .net com dll and runs regasm on it, this setup has no uninstall so unregister Will never be called.. And you can run the setup over and over again.. Is there any danger in doing so?? What would happen if i deploy à new setup with à new version of the dll.. Is there any danger in n...

How to perform edit and delete data from html table row as well as from xml file in the following code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Xml" %> <%@ Import Namespace="System.IO" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...

how do i call a javascript subroutine from mvc server side code?

basically what the title says, i know you can return a javascript view but this has never worked for me. i couldn't find a proper tutorial or explanation about this concept either, if anyone can shed some light on it that would be great (yep, ive tried google countless times). thanks edit: ive used your tips, debugger etc... thanks gu...

Does Resharper not support Microsoft best practices for namespace naming conventions?

I know there are only warnings but they are still annoying me. I like a clean project. I have a solution with two projects. I would like for the namespaces to look like the following Solution.Project.FEATURE Which I thought should map onto the best practice CompanyName.TechnologyName.FEATURE Instead Resharper keeps suggesting a names...

Ajax enabled WCF service not defined

http://forums.asp.net/t/1442084.aspx I created an AJAX-enabled WCF service to call from a web form. the thing is that after creating it, I'm able to populate my dropdown from the items returned by the service. but 2 hours later, I get this FireFox error message when loading the page : "Error: Sys.ArgumentException: Value must not ...

Why is is implemented as as?

Given that this very natural use case (if you don't know what as actually does) if (x is Bar) { Bar y = x as Bar; something(); } is effectively equivalent (ie, compiler generated IL from the above code will be equivalent) to Bar y = x as Bar; if (y != null) { y = x as Bar; //The conversion is done twice! something(); } ...

Is it possible to pass in more than one generically typed parameter to a method?

I currently have this method header: public virtual void SetupGrid<T>() where T : class, new() { } I want to pass in another anonymous class, I guess something like this: public virtual void SetupGrid<T><T2>() where T,T2 : class, new() { } How can I do this? ...