Main Topics
Browse All Topics 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...
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...
Microsoft has a good sample of how to pull of datagrid sorting here: http://msdn.microsoft.com/
However, their samples uses the click of a button. I want the user to be able to simply click the column header and...
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)...
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...
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.DataText
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...
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,...
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...
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
We have 3 related RadComboBoxes that filter a grid as shown in the image and based on the following example; http://demos.telerik.com/a
The second task of the code is...
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...
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:...
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?
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(...
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 =...
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...
please see attached app.config file, when i do this:
Database db = DatabaseFactory.CreateData
where Logging is an entry in my config file:
<configuration>
<configSections>
<section name="dataConfiguration"..
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...
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...
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...
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...
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.
*...
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...
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...
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.
...
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...
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"...
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...
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...
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 ...
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.Applicat
{
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...
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...
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...
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:...
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...
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...
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...
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.
Exception Details: System.Runtime.InteropServ
Source Error:
Line 32: xlApp.Visible = true;
Line 33: string strFileName = sFileName;
Line 34: Excel.Workbook xlWB = ...
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...
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!!!
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,...
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...
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...
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...
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...
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 ...
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:
//...
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...
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...
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."
...
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...
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...
I have this code to check if a row exist in a datatable:
DataRow selectedDataRow = ((DataRowView)comboBoxProd
string rijID = selectedDataRow["id"].ToSt
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.
How can I create Telerik GridView Row Double Click event?
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...
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...
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,...
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...
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...
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...
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?
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();
...
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...
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...
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#...
private void cbo_Country_SelectedIndexC
{
// create an array of provinces
WebSUtil.StateProvince[] stateprovinceArr;
// create a new object srvCountryCode
...
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...
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...
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.
...
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 ?
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...
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.
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.
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:
...
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...
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
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...
How do I let the ParameterizedThreadStart take a List<byte> as a parameter ?
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...
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...
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...
How to get the Project folder path in C#. Example: C:\Documents and Settings\Colorsit123\My Documents\Visual Studio 2005\Projects\Demo\Demo
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...
How do I bind a Combobox to a Dictionary ?
This is what I have.....
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...
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...
kaufmed
566,376
Sage
500 points yesterday
ProfileBuggyCoder
240,764
Guru
10 points yesterday
Profilenavneethegde
158,560
Guru
0 points yesterday
ProfileCodeCruiser
140,708
Master
2,000 points yesterday
ProfileTheLearnedOne
137,350
Master
2,800 points yesterday
Profilewdosanjos
124,511
Master
3,500 points yesterday
ProfileAndyAinscow
107,357
Master
0 points yesterday
ProfileDhaest
98,335
Master
0 points yesterday
ProfileIdle_Mind
91,914
Master
0 points yesterday
ProfiletommyBoy
90,068
Master
0 points yesterday
Profilenishantcomp2512
89,000
Master
0 points yesterday
ProfileMlandaT
86,553
Master
0 points yesterday
ProfileChinmay_Patel
80,818
Master
0 points yesterday
Profileddayx10
66,538
Master
0 points yesterday
Profileanarki_jimbel
66,132
Master
2,000 points yesterday
Profileambience
63,764
Master
0 points yesterday
Profileukerandi
62,593
Master
1,000 points yesterday
Profileapeter
60,772
Master
0 points yesterday
ProfileJamesBurger
60,305
Master
0 points yesterday
Profilesedgwick
52,750
Master
1,600 points yesterday
Profileemoreau
50,917
Master
0 points yesterday
Profileged325
50,311
Master
2,000 points yesterday
Profileanuradhay
49,977
2,500 points yesterday
ProfiletechChallenger1
47,638
0 points yesterday
Profilemas_oz2003
43,540
0 points yesterday
Profile