Top Solutions

Tags:yes, box, message

C# VS 2008/2005 - Dianlogue box button selection. Simple.

I have a YES or NO Dialogue box and when the users selects YES or NO they get another dialogue box informing them of their selection. Simple yea? Mine is not working it lets me click...

Tags:enter, key, press, keypress

In one of my forms, If I hit enter, it automatically hits the button that is highlighted rather than the text box that is currently selected.  I have tried setting the property of the text box to both AcceptsEnter = true and false.  I have hooks...

Tags:C#

Microsoft has a good sample of how to pull of datagrid sorting here: http://msdn.microsoft.com/en-us/library/0868ft3z.aspx.

However, their samples uses the click of a button. I want the user to be able to simply click the column header and...

Tags:C#

I've been trying to send keypresses to another application using SendMessage in C#. So far I've gotten absolutely no results from it. I've tried sending different combinations of these functions to different applications with no luck.
ex)...

Tags:C# (Win Forms)

Hi All,

I have to display thumbnail images in ListView control. How to give space in between thumb image in List View? (like padding to images)

I have tried:
lstDPView.Margin = new Padding(10, 10, 10, 10);   //// Doesn't work... :-(
...

i am using SendKeys.Send("{tab}"); in the key press event of a text box to move to the next textbox by pressing ENTER key

This is working fine, but i am getting an error beep. can anybody plz explain

the code is below:-
private void...

Tags:statement

How do I use an OR statement?  I am trying to say IF this or this then do this.  Here is what I have not working with the ||.

if (cboEstimateStage.DataTextFormatString == "Lockdown") || (cboEstimateStage.DataTextFormatString ==...

Tags:Sharepoint, C#

Hii All,
 I have sharepoint 2010 and i have one Document library. User uploaded some documents. Now user wants to update metadata and word file by only opening file in word. They dont want anybody to edit metadata by using edit property in...

How can I best get the fractional part of a floating point number expressed as an integer?

Assuming the source number is 1234567.89 I want to retrieve just the value 89. In the example below the decimalPortion variable will contain 0.89

I...

Tags:ASP.NET, C#

I am trying to programmatically add a template field to an ASP.NET GridView control using C# code behind. I can successfully add the template field with not problem, the problem I am having is capturing events of the template.
For instance,...

Tags:type, assembly, library

I am using adodb.dll in a C# class.

why am I not able to do this:

regasm adodb.dll /tlb


I get the following error:

[[command line output]]


C:\EES\BIN\RELEASE>regasm adodb.dll /tlb
Microsoft (R) .NET Framework Assembly...

Tags:date, file, modified, created, c

Hi all,

I have an .NET EXE file .
I want to find the file created date and modified date in C# application. Can we do it through reflection or with IO stream?

Thanks
Adib

Tags:ASP.NET, Javascript, C#, AJAX

We have 3 related RadComboBoxes that filter a grid as shown in the image and based on the following example; http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

The second task of the code is...

Tags:proveit, test, answers, questions

I have been asked to take an online exam by a company called http://proveit.com/
in the areas of C# and ASP.Net

I am not looking for sample questions or anything unethical.  
Just looking for your opinion on the structure, range of subject...

Tags:SSRS, reporting services, report viewer control

I am able to render a remote ssrs report inside an aspx page using the ReportVIewer Control.

I would like to pass two variables from code behind to the report parameters as the page loads. Here are some more details:

Parameter 1 Name:...

Tags:ZedGraph, C#, Plotting Line Chart, X Axis

How to put the current date and time on the x-axis of the ZedGraph?
How to make the graph plot lines for 10 minutes and stop?

Tags:convert, datatable, datarow, array

I'm starting to try to fully take advantage of the very powerful "DataSet" structure in .net.  I've learned a few things in the last few days, like how to get child rows based on a relationship.  The call:

DataTable.GetChildRows(...) returns...

Tags:file, process

Hi all,

     I am trying to run a .bat file which in turn contains a command for an application. here is my code.
--------------------
           string filepath2 = strArray[2] + "\\myCmd.bat";
        
           StreamWriter swrr =...

Tags:sendmessage, mouse

i need to click on a button in another application from my C# application, i have API calls working to activate or close the window etc and they work fine so i know i am sending messages, and i know the code for an api mouse click, however i need...

I have the following:
public System.Data.DataSet ds = new System.Data.DataSet();
        public System.Data.DataRow dr = new System.Data.DataRow();
            
it gives me an error...

Tags:Microsoft, Enterprise Library Database

please see attached app.config file, when i do this:
Database db = DatabaseFactory.CreateDatabase("Logging");

where Logging is an entry in my config file:

<configuration>
  <configSections>
    <section name="dataConfiguration"...

Tags:C#, datatable, add, rows, manually

Hi, I want to add rows to a datatable, I created a datatable:  

DataTable dt = new DataTable();
            dt.Columns.Add("Month", typeof(string));
            dt.Columns.Add("Values", typeof(string));

and now I want to add 12 rows, to...

Tags:C#

I want to write some code to format the numeric inputs in a TextBox that each three digit is seperated with a comma, like this: 1,648,195 (like using {0:N0} format string)
But I want to format the input in textbox when typing.
I write a little...

Tags:ASP.net 2.0, c#

Hi,

I am working on ASP.NET 2.0 using C#

I have to list all users avaliable in Active Directory

My Code is not bringing users but bring other informations

Please help me improving the code.

My Result brings the following outputs in...

Tags:Excel, C#, Format Category Axis, Chart Background Color

I am trying to use C# to generate a spreadsheet that has a chart graphing a few non-contiguous rows of data.  I have almost everything working.  There are two things remaining that I cannot figure out how to do.  One is to set the background...

On my computer when I print a report from my application, it prints on A4 paper (default).  But some clients say, when they print from my application, comes out in letter size. They must change paper size prior to every printing. They say other...

Tags:C#

I need to update my regular expression so it has the following:

  * Accepts all positive decimal values (currently only accepts values greater and equal to one (1))
  * i.e accepts ---> 0.0001

  * Can have maximum 3 decimal places.
  *...

Tags:mod


I used to use the mod function in asp to figure out the following while looping through rows in a dataset to display a matrix style grid of products:

if n mod 3 = 0 then
   //start a new row
esle
  //continue adding table cells

How can...

Tags:C#

Here's the situation... I've got a VS.2005 C# WinForms application in which I needed a way to display a powerpoint PPS or a MSWord document inside a form window... after a very large amount of searching and a lot of dead ends I determined the...

Hello, I created a Table from the code and put it into the form. I  do not do anything, but  my html table looks like : <table border="0"> and I cannot change borders. I need border="1"
My code looks like:

Table table = new Table();
   
   ...

I have a form window I open at runtime. It does start center screen. I have some code where every time I click inside of the form, it resizes itself by 10%. When you click it for the 11th time it reverts back to it's original size. I want the...

Hello,

I'm looking for a working implementation of the k-means algorithm in C#.

The implementation needs to work with image data that I have normalized into a 2 dimensional float array:

float [PixelCount, 3] data;
   where
PixelCount...

Tags:C#.NET, Visual Studio 2008

Hey,

===Preamble===
The title pretty much sums up what I am trying to do. I have created a class to help me streamline dealing with Tiff images in .NET. The problem I am having is showing that image, and acting on the file at the same time.
...

Tags:window, handle, hwnd

I need to start a process as a hidden window (see the example code below). I then need to get and save the window handle (i.e. the HWND) for later processing.  Normally I would use a call to MainWindowHandle to do this (as shown in the sample...

Tags:process, cmd, run

I want to start a process in C#. This process does fine by opening up the command prompt and executing the command with the given arguments. However, I want to execute the commands without the command prompt opening up (in a way "silently"...

Tags:ASP.NET, C#, Javascript, TelerikControls, Multiple Related Combos

I have 3 related combos on an aspx page. The 3rd combo populates a RadGrid when it is selected. When this happens and the page posts back the combo selections disappear. The data is coming from SQL2005 for the combos and grids. I have 2 scenarios...

Tags:append, file, text

Hi,

Lets say I have a text file.

Always when I try to write to it with the following code, It erases what was already in it:

                // create a writer and open the file
                TextWriter tw = new...

Tags:.NET, C#

I'm having problems using the .NET 2.0, System.DirectoryServices assembly to perform a simple LDAP search.  

I'm using the following code to perform the search.

1      public void LDAPSearch()
2      {
3        try
4        {
5         ...

Tags:excel, merge, cells

My code follows. please edit the commented merge line to merge the idicated( // ws.Cells. MergeCells(1, "D2:G2");) fields.
Thanks

private void ExcelReport(Excel.Application excelApp, string fileName)
{
  Excel.Workbooks wbooks = (...

I am trying to find an easy way to copy files in C# across servers/domains/account.  I assumed that this would be an easy task until I started researching it about 4 hours ago....

The basic scenario is this:
From my workstationA in workgroupA...

Tags:change, css, class

I am creating a method to set visibility false on a certain panel and then widen another div to consume the rest of that content area in my current design.

However I cannot figure out how to change the class attribute of a div tag that is set...

Tags:C#

Hello,
on my windows form i have a panel control which consist of Label for displaying certain information. i want to print those information directly from panel. but i failed. is there any way to print all the data from the Panel Control in the...

Tags:C#

Afternoon,

I have a date string 05192008 that i need to convert into a string like this: 05/19/2008... Seems easy enough i thought but Convert.toDateTime does not seem to like 05192008 as a valid date string...

What i was going to do was:...

Tags:c#.net, mshtml, html, select, option

Hello,

I'm currently trying to write a simple C# app to automatically fill details from a CSV file into a webpage (in a Webbrowser control on the form) one row at a time to migrate data between an old and new system at work.

I have been...

Tags:stop, thread

I have written a small method that opens a comm port, sends an ATDT string to make a call to a remote modem and then loops waiting for some data to arrive, or timeout returning either the data received or an error string after closing the comm...

Tags:Visual, Studio, C#, Serial, Port

Hi experts!

I have a very simple c# code for sending and receiving serial commands and it works fine. If i send a command and the command is recognized, then I will receive a respond from the serial device. When the command is not recocnized i...

Tags:c#, datatable, dictionary

I have a datatable object in my application (from a MS-SQL Server)
I'd like to convert it to a dictionary like key=column1 and value=column2.
But I don't really know how I can do that.

Tags:0x800a03ec, from, exception

Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC.

Source Error:


Line 32:                   xlApp.Visible = true;
Line 33:                   string strFileName = sFileName;
Line 34:                   Excel.Workbook xlWB = ...

Tags:C#.NET

Using C#.NET VS2005, I have a background worker object. I want to use it to update GUI componets (say a textbox). However, I want to pass that textbox a string parameter from the DoWorkEventHandler.  How do I do this?

I have attached an...

Tags:treeview, find, node

I have a tag value as string in my program....I want to search that Tag value in Tree control and want to select/expand the node with that Tag value. C# please!!!

Tags:objectdatasource, gridview, winforms

I do have a problem I am stuck with for 2 days:

1st and important: It is a winApp, not an WebApp
I am using VS2005, C# on WinXP.

I have an c# object (a class).
I want to display these objects in a gridView. It should be updateable,...

Tags:url encoding .Net WCF

I'm using .Net libraries to encode strings for placement into URLs.  I noticed that httputility.urlencode chooses to encode the space character with '+' (a plus symbol) not '%20' (the hex value).

This is fine with me.  Except that my WCF REST...

Tags:Microsoft, Visual Studio 2005, C#, C++, The handle is invalid

I am working with 2.0 .Net framework.

I am trying to build a class, within a C# class library, which will programmatically read binary data (images) from a database table and then print the images on one or more pages. But, instead of printing...

Tags:disable, button, color

I have two buttons on a windows form. When I click one button, I want to disable both of the buttons but changing the text's color of the button I have clicked (as to differentiate the button that was clicked). Right know, the two lines of code...

Tags:C#, Exchange Server, EWS, ExchangeService

Im using ExchangeService to connect to the 2007 Exchange server
Which uses: http://<Email server name>/EWS/Exchange.asmx

Have no problem access the server and list items in the InBox by other filters

But when I try and get a message...

Tags:C# web services soap call

I have a c# windows form.  I have added a web reference to a web service running on another server on my network.
I have verified that the web service is responding by using VisualWebServiceClient ...

Tags:C# .NET

I want to recover a complete list of computers and the domains that they are in from Active Directory using the functionailty built in to .NET 2.0.  I have determined how to get ALL computers in the default domain using the following code:

//...

Tags:Microsoft bug, pretty annoying, .Net, C#, user control, assembly

This looks like a bug by microsoft, it is pretty annoying and I'm wondering if anyone has a solution, or maybe I'm doing something wrong (And in this case, what am I doing wrong and how to do it right)

I have noticed that on several user...

Tags:C#, .net 3.5, WPF, XAML, WPF Toolkit

I've got objects containing data that I'd like to show on a line chart as separate series.  I'd prefer not to declare each series in XAML, since I'd like to use this for different combinations of data and add/remove series on the fly.

An...

Tags:C#, IE/Firefox

Hello Experts,

I have a web service that I am trying to call and it seems the server (or service) is closing the connection.

"The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."
...

Tags:C#

Experts,

I have various books that I'd like to store in an ArrayList.  I know how to add elements to an single dimension ArrayList, but not a multi-dimensional one.

Here's what I need

ArrayList books = new ArrayList();

// Add a new...

Tags:C#, WCF

Hi, I am completely new to WCF.  My goal is to use a service on one server to connect to multiple C# Windows application clients.  

I got the service running on my web server (a shared asp host, no SSL or dedicated IP), and the service display...

Tags:datarow, row, datatable, c#

I have this code to check if a row exist in a datatable:

            DataRow selectedDataRow = ((DataRowView)comboBoxProduct.SelectedItem).Row;
            string rijID = selectedDataRow["id"].ToString();
            DataRow[] foundRows =...

I want that the sendkeys code perform a CTRL + C. I tried two things(See code) does anybody know how to do this? Or is there a standard code in C# to do the copy to clipboard function.

Tags:Silverlight, Telerik

How can I create Telerik GridView Row Double Click event?

Tags:timeout, tcpclient, connect

I have tried both the TcpClient.Connect and Socket.Connect
to connect to a given port/ip on another system. When the remote
system is off the connect timeout is a bit long. I have tried using
the associated methods to set the timeout. But it...

Tags:xml, create, prefix, attribute

i need to create an attribute "ccc" with the prefix "b" for an element "aaa". The following code adds the prefix but it also adds the namespaceuri to the element with which i am not able to manipulate the file.

Required Output:
<body
<aaa...

Tags:C#, Asp.net, DevExpress

Hi Experts,

I have a devexpress gridview bound to sqldatasource. On the selection of a row in this grid I want to pass student Matric No to second Dexexpress gridview so that it gets populate too with student data. I can get the Matric no,...

Tags:c# asp.net web services write to event log

I am trying to write information to the Event Log from a Web Service.

I am able to create a "CroInternalWebServices" category in the Event Viewer, and I am able to write to it using the code that I have listed.

I can write to the Event Log...

Tags:C#, windows

Good afternoon expert,
Seems like such a simple thing. When a button is clicked the text from user input at textbox is display as a label.
Been working on for two hours and still cannot get it to go. Thanks. Allen
PS getting error message...

Tags:openfiledialog, filter

I am trying to have a openfiledialog filter like below

All Formats|*.JPG,*.TIF|JPEG (*.JPG)|*.JPG|TIFF (*.TIF)|*.TIF


But obviously the All Formats is not working.

Hi Experts,

I have some code I am using where I split a comma delimited file (originally and excel sheet) into columns to insert into a table via dataset. Now I need to modify the code so that I can choose to read specific columns only from...

Tags:WPF, C# Mouse, LeftButtonDown

Hi, I'm having trouble capturing LeftButtonDown and MouseDown events for the button in Wpf.  Right button events are captured fine, but left seem to be ignored.  Is this a WPF bug or am I missing something really simple?

Tags:excel, read

Hello experts:
I'm trying to load the load test.xls contents thru c# code so that I can update some data base fields:
My code is below:

public class BankParserClass

Excel.Application excelApp = new Excel.ApplicationClass();
...

Tags:windowsidentity, networkcredential

This is a sticky one. Here's the situation.

In the front, I have an ASP.NET app that does not require the user to logon, though all users are logged onto the domain.

In the middle, I have a windows app that receives MSMQ messages from the...

Tags:gridview, rowcommand, row

I have a hyperLink inside a gridview that calls a row comand and it works fine.
However the problem is that when I try to use the paging on my grid view it tries to execute the RowCommand in the code behind and I get an error.
I need the...

Tags:C#

I am using VS2005 to build a windows application.  I have a DataGridView with selection mode set to FullRowSelect and all columns have sortmode = automatic.  Yet when i click on the column header the data does not get sorted and the little...

Hello,

I have been stuck on this for nearly 2 weeks now and can't see the problem. All Internet searches have shown what I have is correct, but it doesn't work for me.

Basically, I'm setting the Select Command for my SqlDataSource in my C#...

Tags:cast, object, unable

private void cbo_Country_SelectedIndexChanged(object sender, EventArgs e)
        {

            // create an array of provinces
            WebSUtil.StateProvince[] stateprovinceArr;

            // create a new object srvCountryCode
    ...

Tags:C#, Visual Studio, labels

I am trying to dynamically create Labels on my form. When I run the following code I get the error "Object reference not set to an instance of an object". (@ line 16 refering to label). Not really sure why...
My design requires that I do use an...

Tags:crystal reports, visual studio, asapx. net 4

I've been looking all over the internet trying to find a solution for "bobj is undefined" whenever I use a crystalreportviewer on my web site.

I'm using VS2010 professional and I installed the Crystal Reports for VS2010 few weeks ago following...

I am using kerr.credentials - which is a win32 assembly.  My c# app works fine with this until i deploy it on a machine without visual studio installed.  Then it cannot load the win32 assembly (which wraps native c and c++ code).  

How can I...

Tags:credentials, cannot, used, local, connections

I am trying to use WMI in C#. The last line of the following code throws a ManagementException "User credentials cannot be used for local connections".  The adminUid and adminPwd are both valid on the machine I am querying.
           ...

Tags:Print Screen, C#, Visual Studio

What is the easiest way to create a "File, Print"
event that will print everything that is on my C# 2008
WInForm, similar to the Print function when on
a webpage or in Microsoft Word/etc ?

Tags:snmp

Hello,

I want to create an application using C# (or any other .NET language) that will receive SNMP traps. However, my hours of web searching for the SNMP API for .NET has turned up very little. MSDN does have a brief description of the...

Tags:.NET Mobile, VB.NET, C#, Symbol, Motorola, barcode scanner

I am able to upload a program to the barcode scanner, with CE 5.0, and it has wireless access to the LAN, but I am not able to scan. I probably will need libraries, and I will have to activate them. Please some help.

Tags:WPF, C#

The following C# code is a handler that make sure that a Windows Form TextBox accepts numbers only including decimal point (one only). I want to do the same for a WPF TextBox, unfortunately there is no KeyPress event.

Tags:MySql, Entity Framework, code first, asp.net, c#

Have a problem with MySql and Entity Framework 4.1 code first.
I create following dbContext:
 
The model:
 
In web.config I added:
 

Table is already created, and I cant get the date from it.
 
On the second line i get an exception:
 ...

Tags:c#, LINQ

hi, i have a LIST<t> and a dataset.  i'm using LINQ to join the 2 data objects together and my final result is i want to update the items in the list with linq joined records.
my code is below.
in the issuecollection list, i wish to update the...

Tags:C#, LINQ

Hi Experts,

Im trying to figure out the way to take my User table and shove it into the IEnumerable<DataRow> type collection.
According to to this Microsoft example (http://msdn.microsoft.com/en-us/library/bb386921.aspx) this should work, but...

Tags:button, border, remove

Hi,

I am currently doing C# programming on Forms. I have notice that everytime I used a flat button, there will be this border around the button. Is there a way to remove the border of a button? This is because I need to do a hover image on...

Tags:Windows C#

How do I let the ParameterizedThreadStart take a List<byte> as a parameter ?

Tags:namespace, could, found, type, name

Hi,

I am using Microsoft Visual Studio.NET 2003. I am trying to do somw work with EXCEL and keep getting the following error.

The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly...

Tags:C#, NamedPipes, NamedPipeServerStream, Asynchronous, Async

I've done a few days of research attempting to understand how to use NamedPipes asynchronously in C#, but have not had any luck. There are plenty of examples and references, but I don't seem to be understanding them well enough to know what I'm...

Tags:choice, multiple, questions

Hi All,

I am not sure if I can ask you guys in this forum.

I am appearing for a Technical Certification in C# in my company.

Want to know if there is any site which offers "Free" sample multiple choice questions on .NET and C#.(except...

Tags:path, get, folder, project

How to get the Project folder path in C#. Example: C:\Documents and Settings\Colorsit123\My Documents\Visual Studio 2005\Projects\Demo\Demo

Tags:C#, ADO.net

I have a DataRow[] and I want to convert it to a DataTable. Is there any direct way of doing it or i need to read the DataRow[]   row by row and add one row at a time to the Table. Also if i do this, i would have to add equivalent columns to that...

Tags:C#

How do I bind a Combobox to a Dictionary ?
This is what I have.....

Tags:C# Microsoft Word Bullet Points

Hi,
I am using C# to automatically populate text in a Word Document. I need a certain paragraph to have bullet points but the next paragraph revert to normal text. I can insert the bullet points but cannot remove them. I am using the following...

Tags:datetime, ticks, milliseconds

hi All:

Can someone please help me understand exactly why we need to add 621355968000000000 when using the DateTime function as per the below JLCA reference example.   I read these JLCA statements below, but still trying to grasp what is...

Loading Advertisement...

Top C# Experts

  1. kaufmed

    566,376

    Sage

    500 points yesterday

    Profile
    Rank: Genius
  2. BuggyCoder

    240,764

    Guru

    10 points yesterday

    Profile
    Rank: Sage
  3. navneethegde

    158,560

    Guru

    0 points yesterday

    Profile
    Rank: Wizard
  4. CodeCruiser

    140,708

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  5. TheLearnedOne

    137,350

    Master

    2,800 points yesterday

    Profile
    Rank: Savant
  6. wdosanjos

    124,511

    Master

    3,500 points yesterday

    Profile
    Rank: Genius
  7. AndyAinscow

    107,357

    Master

    0 points yesterday

    Profile
    Rank: Genius
  8. Dhaest

    98,335

    Master

    0 points yesterday

    Profile
    Rank: Genius
  9. Idle_Mind

    91,914

    Master

    0 points yesterday

    Profile
    Rank: Savant
  10. tommyBoy

    90,068

    Master

    0 points yesterday

    Profile
    Rank: Genius
  11. nishantcomp2512

    89,000

    Master

    0 points yesterday

    Profile
    Rank: Wizard
  12. MlandaT

    86,553

    Master

    0 points yesterday

    Profile
    Rank: Genius
  13. Chinmay_Patel

    80,818

    Master

    0 points yesterday

    Profile
    Rank: Genius
  14. ddayx10

    66,538

    Master

    0 points yesterday

    Profile
    Rank: Sage
  15. anarki_jimbel

    66,132

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  16. ambience

    63,764

    Master

    0 points yesterday

    Profile
    Rank: Sage
  17. ukerandi

    62,593

    Master

    1,000 points yesterday

    Profile
    Rank: Guru
  18. apeter

    60,772

    Master

    0 points yesterday

    Profile
    Rank: Sage
  19. JamesBurger

    60,305

    Master

    0 points yesterday

    Profile
    Rank: Sage
  20. sedgwick

    52,750

    Master

    1,600 points yesterday

    Profile
    Rank: Genius
  21. emoreau

    50,917

    Master

    0 points yesterday

    Profile
    Rank: Genius
  22. ged325

    50,311

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  23. anuradhay

    49,977

    2,500 points yesterday

    Profile
    Rank: Guru
  24. techChallenger1

    47,638

    0 points yesterday

    Profile
    Rank: Guru
  25. mas_oz2003

    43,540

    0 points yesterday

    Profile
    Rank: Genius

Hall Of Fame