I know 2.0 supports "anonymous methods" (or "closures"), but I don't see
the ability to assign a block of code to a variable (I think they are
simply "blocks" in Ruby).
Am I correct? They seem logically to go hand in hand......
more >>
Using List.Contains()
Posted by Brian Pelton at 11/22/2005 3:32:02 PM
I feel like I'm about to get in over my head, so before I go off the
deep end I'm hoping someone can point me in the right direction.
I started down the road of using a List<> of an Interface type.
I wanted to be able to use List.Contains() to determine if the List
already has a certain ob...
more >>
New to threading. Need suggestions
Posted by MS at 11/22/2005 3:25:37 PM
Hi. I'm new to developing and c#.
I'm developing a tool that allows a user to select a directory with
specially formatted files. The tool then iterates through the list of files
in the directory and sends their content via msmq. The part that iterates
and sends the files is in a separate t...
more >>
C# Console application does not show System.Windows.Forms
Posted by Charts at 11/22/2005 3:22:03 PM
I have a C# console application and I need pop up a Messagebox. However the
IntelliSense
does not show for using System.Windows.Forms; So, the application does not
recognize the MessageBox. Please advice. Thanks!
...
more >>
Read integer value from Excel file failed
Posted by Hardy Wang at 11/22/2005 3:13:31 PM
Hi all,
I have following code to read Excel content into a DataSet
string connection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
fileName + ";Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1;\"";
OleDbConnection conn = new OleDbConnection(connection);
try {
DataSet...
more >>
Exception has been thrown by the target of an invocation
Posted by Brett Kelly at 11/22/2005 3:09:34 PM
Hello,
I'm trying to dynamically create instances of objects using
Activator.CreateInstance(), but I'm getting the above error.
Here's the code that calls CreateInstance:
-------------------------------
Type t = em.GetTypeByExt(ext);
object[] targs = new object[]
{me.Filename,me.TargetD...
more >>
Most efficient way of applying multiple conditional logic
Posted by booksnore at 11/22/2005 2:13:49 PM
..eh I was stuck thinking up a subject title for this post for a while..
So I am processing a really big file (scary big). Each record is fixed
length, I need to test conditions on certain fields in the record. At
the moment the most efficient way I've found to process the data is a
series of ...
more >>
Properties question
Posted by LDD at 11/22/2005 1:26:26 PM
What is the real benefit of using Properties?
You can declare class variables either public/private.
I'm not sure I understand the true benefit. Especially if you are reading
from/writing to these variables
...
more >>
autosize an image for a pictureBox's size
Posted by Al at 11/22/2005 11:41:33 AM
I'm using visual C# 2005 Express Edition and I would like to open the
image in the picture box, without make the picture box larger. For the
moment, the code is:
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
Image img = I...
more >>
help with frames
Posted by pete K at 11/22/2005 11:26:06 AM
I'm sure this is something simple that I'm missing, but here's my problem.
I have two frames.
<frameset>
<frame name="rtop" src="something1.aspx">
<frame name="rbottom" src="something2.aspx">
</frameset>
What I want is for "rbottom" to display a form and when the user presses the
OK but...
more >>
hiding tabpages
Posted by Turxoft at 11/22/2005 11:18:54 AM
I have a tabcontrol in my form. I want to hide the tabpages. I want the user
cant change the tabpages and do it by code.how can I?
...
more >>
Size of Heap at some location in program
Posted by OBINT at 11/22/2005 11:12:39 AM
Hi
How can i know the current status of Heap at a specific location of =
program. I want to put a break point in program and want to know what is =
the status of my heap at that time.
OBINT...
more >>
Disconnecting form the SQL server
Posted by John J. Hughes II at 11/22/2005 11:05:21 AM
I have an application that connects to an SQL server. I need to be able to
disconnect all connection that I opened. I am closing and disposing the
connection but the connection pool is keeping them alive for later use. How
do I convince the connection pool to drop the connections without cl...
more >>
Big Endian Format
Posted by Matt at 11/22/2005 10:54:27 AM
I receive a file from a client and the first 8 bytes are in Big Endian
format to denote the length of the following data. This is one of the
security requirements. I also have to do the same thing when sending a
response file back to them. Does anyone know an easy way to convert this
Big ...
more >>
FileInfo doesn't expose FileType
Posted by kids_pro at 11/22/2005 10:28:43 AM
I found FileInfo expose alot of methods & properties.
However I can't get FileType from FileInfo I can only get File extension.
How can I get fileType any build-in library allow me to do that?
If not please advice on what is the best way to get file type.
Many thanks,
kids...
more >>
hiding tab control tabs
Posted by Turxoft at 11/22/2005 9:56:55 AM
I want to use tabcontrol in my form.I add several tab pages but want to hide
the tabs.
...
more >>
on button click form moves to the top
Posted by gjtired at 11/22/2005 9:38:11 AM
Hi,
When I click a button or dropdown box at the bottom of the web form the
focus shifts to the top of the form. What can I do to make it stay
where it is at?
Thanks
Gayle
...
more >>
Regex
Posted by Maya at 11/22/2005 9:19:21 AM
Hello,
Im trying to retrieve a text between the <body> and </body> tags in an
HTML file using this code:
public string ReadContentsFromPage(string sb)
{
Regex S = new Regex(@"<BODY>(.*)</BODY>",
RegexOptions.Multiline | RegexOptions.IgnoreCase |
RegexOptions.Compiled);...
more >>
allowing exclusive access to a file on the network
Posted by David C at 11/22/2005 9:18:24 AM
I have a desktop application which uses AxPdf to view PDF file.
axPdf.LoadFile("myFile.PDF");
Without going into much detail, I need to make sure that only one person
has a given file in the PDF viewer. So before calling LoadFile, I need
to make sure that nobody else is reading the file.
...
more >>
RichTextBox select text... Need top level select, not internal slc
Posted by RobKinney1 at 11/22/2005 8:33:06 AM
Hello and thank you for reading this post.
I have a RichTextBox. I need to select text inside for a search feature.
Easy enough... right? Well apparently from the .NET help and everything from
the net, there is nothing describing how to do a top level select that I can
find (ie like how ...
more >>
How to call aspx page from C#
Posted by sudeeprgaitonde NO[at]SPAM gmail.com at 11/22/2005 8:15:48 AM
Hello,
I am forming a aspx url with query string parameters as variables.
sUrl = "http://abcd.com/getresults.aspx?zipcode=" + zipcode +
"&areaCode=" + areacode + "&Landmark=" + landmark;
When this url formed is run in IE, it returns an xml in the browser.
Now I want to duplicate this fun...
more >>
List generic having strange behavior
Posted by rdh at 11/22/2005 8:01:04 AM
I'm using List<> to store a class of positions.
Position are basically latitude and longitudes (doubles).
the line is something like
List<position> P = new List<position>();
Then I start adding to the List.
P.add(Positions);
After about 120 entry the List starts writing the enrty a...
more >>
Using Generic Classes as Type Parameters
Posted by Levi at 11/22/2005 7:53:15 AM
class A<Ta>
{
public A() { }
}
class B<TA, Ta>
where TA : A<Ta>
{
public B() { }
}
class Program
{
static void Main(string[] args)
{
B<A<int>, int> var = new B<A<int>, int>();
//how I'd like to do it
//B<A<int> > = new B<A<int> >();
...
more >>
Reference page cast not working
Posted by R Reyes at 11/22/2005 7:21:06 AM
Error: Unable to cast object of type 'ASP.CompanyDirectory_aspx' to type
'CompanyDirectory'.
Code:
clsCompanyDirectory = (CompanyDirectory)Context.Handler;
getCompanyProfile(Strings.ConvertToInt(clsCompanyDirectory.CompanyIDValue));
Question: I have other pages with the exact same code an...
more >>
C# - ADODB - Failure to connect on deployment
Posted by Ames111 at 11/22/2005 6:58:42 AM
Hi
I have an application that connects to a SQl database on my computer
via an ADODB connection:
ADODB.Connection Conn = new ADODB.Connection();
Conn.ConnectionString = ("Driver={SQL
Server};Server=4P-12.Leighton.local;Database=HD;Uid=l0073;Pwd=cheese");
Conn.Open(dbconnection, "", "",...
more >>
MDI form question
Posted by Ann Huxtable at 11/22/2005 6:46:54 AM
I am writing an application which consists of a toolbar and a "monitor"
window. I want the monitor window to be able to show process information
from different running processes (each in its own tab).
When I get to the section of the code where I am setting the MDIParent
property, the appli...
more >>
Different printing settings
Posted by Gidi at 11/22/2005 6:03:02 AM
Hi,
I've created a form that prints a document which i created (with the
printDocument class), I draw the page's lines and text. when i'm printing it
on my computer, with my printer, the printing is ok, the page boundes are ok.
but when i take my project *.exe file to a computer which have ...
more >>
DataGrid and DataSet
Posted by Gidi at 11/22/2005 5:56:05 AM
Hi,
I have dataGrid which at first it's empty. i have another dataGrid which
contains checkbox column, what i want to do is, that everytime a checkbox is
checked, my dataGrid will be filled with data. So my question is, Is it
possiable to add a data to dataSet without erasing the data that ...
more >>
change calling directory
Posted by funkforce at 11/22/2005 2:08:51 AM
Hi
I would like to change the calling directory of my console c#
application to sometgin else.
For example calling myapp like this:
C:\temp\myapp.exe
I want myapp to execute and then exit but it should exit in another
directory for exampel in c:\windows.
How can this be done?
Regar...
more >>
Wrtite Mesasges to Windows Event Viwer
Posted by Abra at 11/22/2005 1:54:30 AM
Hi,
I would like to be able from my C# .NET application to send
(programatically) different debug messages to an own directory in the
standard Windows Event Viewer. Which .NET classes provide access to the
Windows Event Viewer ? Is it possible to configure it to automatically
log the messages i...
more >>
Avoid formatting codes when printing or saving
Posted by gsb58 NO[at]SPAM hotmail.com at 11/22/2005 1:12:51 AM
Hi!
I've made a simple text editor as a training issue in C#.NET.
It is a TextBox control on a form.
However when I save the file or
send to printer I'll get the following
{\rtf1\ansi\deff0{\fonttbl...
and so on with the actual text embedded.
How can I in the code set the ri...
more >>
XML Problem writing \r\n
Posted by Tomas Vera at 11/22/2005 1:02:19 AM
Hello All,
I'm having trouble writing some special characters to an XML file.
I need to output a XMLSS formatted file to be read by Excel.
In some cells there will be some text that contains CR-LF pairs such
as
"this is a long entry\r\nThis is the secondline".
I'm building an XML documen...
more >>
designer support : browsing for a file
Posted by Sagaert Johan at 11/22/2005 12:12:53 AM
Hi
I managed to put properties of a usercontrol in the designers properties
window.
I can enter a string, but i would like to browse for a filename (like when
setting the image property for an image control )
What attributes should i add to make this possible ?
Johan
...
more >>
Why C#
Posted by AliR at 11/22/2005 12:00:00 AM
Hi All,
The question is why should I use C#?
If am developing a windows application, what are the advantages of using C#
versus VC++ (MFC)?
Thanks
AliR.
...
more >>
Post build events
Posted by Allan Ebdrup at 11/22/2005 12:00:00 AM
Hi
I'm Using VS.Net 2003 and am trying to get the app.config file copied to the
directory of the target dll by using a post build command.
In Properties/Common Properties/Build Events/Post-build Event Command Line
I've entered:
"copy $(ProjectDir)app.config $(TargetPath).config"
that shoul...
more >>
eventhandler
Posted by Maarten at 11/22/2005 12:00:00 AM
might be a stupid question but
can i set an eventhandler for a variable?
regards Maarten
...
more >>
File Copy to Hidden Share
Posted by AdrianJMartin at 11/22/2005 12:00:00 AM
Hi all,
I just written a app that attemps to copy a user selected file to a
bunch of users machines.
Trouble is that when call System.IO.File.Copy( src , dest , true ) i get a
Unauthorised Access Exception thrown. dest is would be something like
"\\UserMachine01\c$\localScripts\th...
more >>
Struct of Class
Posted by Simon Hart at 11/22/2005 12:00:00 AM
Hi,
Is there any benefit in terms of performance to using a Struct over a class
to store objects?
Regards
Simon.
...
more >>
Accessing com classes from c#
Posted by Stephan Zaubzer at 11/22/2005 12:00:00 AM
Hi
I relatively new to C# and at the moment I am having troubles accessing
com objects within C#.
I am working in VS.net. I add the com library I want to access to my
references. Accessing classes exported in this com interfaces will throw
a System.Security.SecurityException.
(System.Secu...
more >>
DataGrid
Posted by Rodrigo Ferreira at 11/22/2005 12:00:00 AM
Hello,
In my project i have a datagrid with 3 columns:
ID C1 C2
1 Image true
2 Sound true
In C2 i have a CheckBox.
What i want is: when i change de checkbox state, run the CheckedChanged
event. Inside this i have a sql coman...
more >>