.net-2.0

DataGridView Place a frozen column to the far right

I have a DataGridView in a WinForms 2.0 App that has a lot of columns, enough that even when maximized the user has to scroll to see all columns. The far right column is a delete button. We want to always display the delete button without the user having to horizontally scroll. When I try setting column.Frozen = true; it removes my ho...

DataGridView Sort repositions the horizontal position of grid slightly

I have a DataGridView with a lot of columns which causes a horizontal scrollbar. However, when I scroll all the way to the right and sort on a column the datagridview slightly repositions itself, but the scrollbar remains all the way to the right. I want to stop this behavior and keep the grid in the same position it was in before the ...

Speeding up listbox insertion time

I need to add 950 strings that are 2500 characters in length to a listbox. The method I am using below takes 2.5 seconds and ideally it needs to happen in less then 500ms. Stopwatch sw = Stopwatch.StartNew(); listBox1.BeginUpdate(); listBox1.Items.AddRange(items.ToArray()); listBox1.EndUpdate(); sw.Stop(); What would be the best wa...

VB.NET Remove user from active directory

Hi I am trying to create a VB.NET application which will (hopefully) reduce some time spent on some of my departments helpdesk calls. The part that I am stuck with is how to use VB.NET to remove a user from a group. The following is code that I have been playing with: Public Shared Sub RemoveUserFromGroup(ByVal deUser As String, ByVal...

How to decode OAuth 2.0 for Canvas signed_request in C#?

I'm able to successfully validate the signed request for a Facebook canvas app using the example here, but I'm unable to decode the payload. The Facebook documentation states that the 2nd parameter in signed_request is a base64url encoded JSON object. In PHP the payload is decoded using json_decode: $data = json_decode(base64_url_dec...

GenerateResource / CoreResGen suddenly taking almost 30 times as long

Starting a few weeks ago, compiling a project (VB.NET, .NET 2.0, VS 2010) has taken several times as long as before. In Task Manager, I noticed ResXtoResources.exe taking lots of CPU for a while. I've finally been able to get some data on this using MSBuild's 'Diagnostic' output setting, and comparing that output to what I see in a branc...

ASP.NET - PDF Component in Medium Trust

Hi,I want to konw if you have solved this problem.I got the same trouble,I have test lots of tools,but I have not found it. If you have found one,can you introduce it to me? Thanks ...

How to create an object of any class that is available in the solution

I have a serious question for you guys. I am working on a project that has hundreds of classes. Why cant i access all classes if i want to create an object of that class. For example: I have Class A, B and C. In Page 1, i can create an object of A and B but not C. When i try to type in Class C, the intellisense does not work. I need t...

Autocomplete using Ajax

Hi, I want to provide an autocomplete option for a text in my web applciation . I have the master data in the SQL server database table. I beowsed in google and found how to use autocomplte. all the examples use web service to do this. I cannot create a web service to impltement this. Is it possible to implement autocomplete by looking ...

"Compatibility Pack" for backporting new .NET Framework features?

For various reasons I often find it desirable to write code that is compatible with .NET framework 2.0 or 3.5 or compatible with the .NET Compact Framework, but it is a problem that there are numerous "small" features in new .NET frameworks that are not available in the older frameworks or Compact Framework. For example, I find extensio...

ArrayList.Sort() with IComparable implementation

When I write this code, I get an error on the Sort() Method. ArrayList al = new ArrayList(); al.Add("I"); al.Add("am"); al.Add(27); al.Add("years old"); foreach (object o in al) { Console.Write("{0} ", o.ToString()); } al.Sort(); Console.WriteL...

what's the use of string.Clone() ?

there are 2 examples of code: # 1 string str1 = "hello"; string str2 = str1; //reference to the same string str1 = "bye"; //new string created and # 2 string str3 = "hello"; string str4 = (string)str3.Clone();//reference to the same string str3 = "bye";//new string created looks like they are identical aren't they? so what is ...

Calling ASP.NET 2.0 authentication service from non-web client

I am working on a .NET 2.0 winforms application that calls an ASP.NET 2.0 website. The website is authenticated using forms authentication. The authentication service is enabled in the web.config, and I have done some experiments to confirm that I can access the service via JSON. Here is my question: is there any built-in code to consum...

How can this be not equal?

My Goal: Extracting one value from an Excel Range, and verify for these cells' value to be the same within this range; When a cell's value is not the same as the other, I need to return null. Here's a piece of code: internal object GetValueFromCells(string start, string end, Formats format) { // Verifying for empty or null parame...

ASP.NET dynamic Command Button only fires every other time

Similar to this question here ASP.Net Dynamic Command Button Event Not Firing but with a slightly different problem. Provided below is a (very) condensed version of my code. protected void Page_Load(object sender, EventArgs e) { RenderDataItems(); } private void RenderDataItems() { pnlDataItems.Cont...

Javascript for a popup

What Javascript has to be written for a popup when a link is clicked? Correct me if there is anything else to be done. Link is written like this. <div style="float:left; padding-left:9px;"><asp:LinkButton ID="lnkActiveInactive" runat="server" OnClick="lnkActiveInactive_Click" CssClass="linkclass" Font-Underline="True">Cancel My Accoun...

When I publish a WCF rest service in IIS the services do not work?

Im using WCF REST 4.0 meaning to say their is no .svc file.. So I have 3 different service classes in one service WCF Rest Application project. And I registered all these services in the Global.asax What im trying to do is that I have a set of Business Functions from a lower framework e.g: .NET 1.0/2.0 where in i use datasets and not ca...

Active Directory User Group Membership

I am trying to get a users group membership and limiting the results to those that match a string, ie I am only interested in the users group membership where the group begins with "test-". The following is what I have been playing around with, even though the user is apart of several groups that match the search string, the If statemen...

How to position a find dialog to not cover the found text?

I created a modeless find dialog for use in searching in a RichTextBox and am having trouble positioning the find dialog after the found text is selected so that it does not cover the selected text. I have tried to get the line number relative to the client area using the following: this.lineCount = this.rtb.Height / (this.rtb.Font.Hei...

Why .NET doesn't have built-in Observer pattern like Java?

I wonder why .NET framework doesn't have pair (Observer/Observable) interfaces similar to Java's feature? EDIT: yes i know about events and delegates but using those interfaces is a simple and bookish approach of this DP isn't it? ...