all groups > c# > june 2004 > threads for monday june 7
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
arrays again
Posted by Eric Eggermann at 6/7/2004 11:48:12 PM
Thanks for the help last week, but I've got a new problem with a different
array now.....sigh.
I want to use an ArrayList to hold unique integer arrays. I've written a
comparer class which works when I call the function explicitly, but when I
use the Sort and BinarySearch functions of my ArrayLi... more >>
Theory Question on Accessing Data from A Running Instance of Word
Posted by Scott C. Reynolds at 6/7/2004 10:21:11 PM
Okay, say you have a running instance of Word, likely a temporary (as
yet unsaved) document, and another piece of software is putting data
into this document.
Now imagine you need to grab said data for your own app to do some stuff
with. Where would I begin to delve into how to do such a t... more >>
data grid
Posted by das at 6/7/2004 10:21:02 PM
Hi all
I'm using Data Grid in asp.net. There is a boolean field in the datagrid column. I want that if field is true then the fore color should be black else the fore color should be read. I can do this with the loop. but is there any property to do it automatically
Thanks in adavance..
das... more >>
why i can not update data in a table without primary key ?
Posted by ¹ùÑÇ·æ at 6/7/2004 9:58:17 PM
first of all ,i will thank you for reading this . :-)
i am writing a programming to access SQL-SERVER.
i use some codes as follows in order to update data changed in datagrid1.
but i found that it dose not work with a table without primary key.
How can i solve this problem ?
*************... more >>
Resize components in a Form
Posted by Poul C at 6/7/2004 9:46:04 PM
Hello
With the code below I can resize all the components on a Form when ever the
Form resizes.
For the time beeing it dosn't allow a component to contain another
component, but with a little extra work I can make it work at any dept!
Problem: I can change Left,Top,Width,Height, but ... more >>
Displaying records in Data Grid
Posted by sups sups via .NET 247 at 6/7/2004 9:19:53 PM
Hi..
I have two tables one called State and the other called City.
State City
State_ID City_ID
State_Name City_Nm
State_ID
and so on..
I have created 2 datagrids.
In the upper datagrid i want the state table to be displayed.When the user clicks on each cell of ... more >>
two dataset in one CheckedListBox
Posted by mel at 6/7/2004 9:16:02 PM
Does anyone know how to count only the values from the second tables in a CheckedListBox
Eg. CheckedListBox = cbl
DataSet1=Table
DataSet2=Table
Thx.... more >>
Is this not plain wrong, BinaryFormatter
Posted by Alexander Muylaert at 6/7/2004 9:06:04 PM
Hi
for some reason the BinaryWriter is Closing the stream when disposed. I
don't want it to close the stream. According to my logic the BinaryWriter
should Write to the stream, nothing more. If I want the stream to close, I
will close it myself, not some helper class.
According to me the... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
switch statement
Posted by Mark Broadbent at 6/7/2004 8:46:01 PM
How on earth did Anders & co arrive at this awful switch/ case/ select
statement?
Not only does it lose the abilty to do an intelligent switch a-la VB
eg. using >, <, list of values etc
.... but it also lacks a "C# feel"
e.g. I would have expected a brace pair to be required between each case
... more >>
Execute Code @ Certain times
Posted by Drew at 6/7/2004 8:16:06 PM
I am looking to run a function at 10 after of every hour of the day. Does anyone know how to do this - or where I should look. I tried using a timer and adjusting the elapsed time - but I would like the program to just ececute @ 10 after every hour instead of waiting on a counter
Thanks - Drew... more >>
How to test if an enum is inside a set
Posted by Alexander Muylaert at 6/7/2004 7:43:18 PM
Hi
I hate this syntax
MyEnum aEnum;
...
if ((aEnum == MyEnum.Green) || (aEnum == MyEnum.Red) || (aEnum ==
MyEnum.Yellow)) ...
In delphi we have something like
if aEnum in [Green, Red, Yellow] then begin
end;
I'm looking for something like this in C#.
I can't f... more >>
Problem on encryption and decryption
Posted by Stephanie Yao via .NET 247 at 6/7/2004 7:34:02 PM
Hi, I've got some problem on encryption and decryption,here is my code:
public string Encrypt(string eptData)
{
MemoryStream ms = new MemoryStream();
transformer.IV = initVec;
transformer.Key = encKey;
ICryptoTransform transform = transformer.GetCryptoServiceProvider();
... more >>
multiple initializers in for?
Posted by Beeeeeves at 6/7/2004 7:25:04 PM
Is it true that in C# you can only have initializers of one type in a for
loop?
For instance I can put
for(int a = 1, b = 2; a < b; a++)
but I can't have
for(int a = 1, string b = "yo"; a < 10; a++)
... more >>
Getting a reference to an "object" from the WebBrowser Control?
Posted by Robin Tucker at 6/7/2004 5:39:34 PM
Hiya,
I'm using mshtml and the web browser control to embed an OLE object in my
..NET application.
What I want to do is get a reference to the "object" embedded therein:
The HTML looks something like this:
<html>
<body>
<object classid="clsid:260AACA0-F963-101B-8955-0000C0DCD465"
... more >>
Displaying X row in my Win datagrid
Posted by VM at 6/7/2004 5:26:04 PM
When I attach my datagrid to a source (table), it displays the row 1 as the
first visible row in my grid. Instead, I'd like to display row 400 as the
first (plus all the subsequent rows). I can still scroll to all 399 previous
rows, but I don't want to make them visible.
Thanks.
... more >>
datagrid dynamic total row
Posted by jon NO[at]SPAM ferrand.com at 6/7/2004 5:12:40 PM
I have a datagrid with a total row on the bottom. What is the best
method to "instantly" update the total row when the value of any row
changes. I am running into problems when I use the column changed
event to calculate the total and assign it directly to the grid ->
myDataGridObject[totalrow... more >>
Reflection
Posted by QQ at 6/7/2004 5:07:04 PM
I am trying to use reflection to access the private property of
OpenFileDialog fileNames property. I have the following code :
filedlg.InitialDirectory = directory.Text;
filedlg.Filter = "xml files (*.xml)|*.xml" ;
filedlg.FileName = "*.xml";
filedlg.ValidateNames = false;
if... more >>
all about disk...
Posted by Paul at 6/7/2004 5:01:03 PM
Hi
What .NET class can I use to do what disk management mmc/diskpart.exe does, i.e. list all partitions in the local drive, delete a selected partition, extend a selected partition, etc.
Thanks
Paul... more >>
MouseMove event triggered even if the mouse is not moving
Posted by Sam Sungshik Kong at 6/7/2004 4:57:36 PM
Hello!
If I understand correctly, MouseMove event is triggered when the mouse moves
(ie when point changes).
I, however, found out that it's triggered even if the mouse is not moving.
What I did was:
In an empty form, I set the Form1.Text to "0" and added the following code
for Form1.Mou... more >>
Setting Share Permissions Using .NET
Posted by Joey at 6/7/2004 4:52:51 PM
Hey,
I need to change a Share's "Share Permissions" using .NET, and without using
WMI, is it possible?
Thanks ahead!
--Joey
... more >>
Reflection Question
Posted by QQ at 6/7/2004 4:34:43 PM
I am trying to access the private property of a OpenFileDialog class.
OpenFileDialog filedlg = new OpenFileDialog();
filedlg.InitialDirectory = directory.Text;
filedlg.Filter = "abc files (*.xml)|*.abc" ;
filedlg.FileName = "*.abc";
filedlg.ValidateNames = false;
if (fil... more >>
"a field initializer cannot reference the nonstatic method xxx" error
Posted by TS at 6/7/2004 4:16:13 PM
I am trying to create a page template. I am trying to set the value of a
field to the return value from a method. What do I have to do to get m_form
set to the value returned from a method? (the compiler won't let me do
this:)
// Form in the page
public HtmlForm m_form = FindFormTag();
pub... more >>
A way to show tooltips for my own classes
Posted by Mike at 6/7/2004 4:14:01 PM
Hi.
In VS.NET 2003, when I'm typing a reference to a system class or namespace,
tooltips pop up
giving not only the parameters and variables of methods, but also a short
text descriptions for these methods, classes and namespaces. For
instance, I type System.Diagnostics.Debug.WriteLine, and ... more >>
Event log box
Posted by Mike at 6/7/2004 4:11:57 PM
Hi.
I'm new to application design. I'm writing an app that's just going to have
few buttons which perform a task when clicked. I want each task to be able
to write out what it's doing to a textual on screen log.
A perfect example of this the old style modem connect box. When you click
Co... more >>
Searching a file
Posted by Sam at 6/7/2004 4:01:03 PM
I have looked at the Directory, File and Path classes but couldn’t find what I want. Is there a way to find a file on the harddisk or the path? Like a search where you give a file name and it returns the directories in which it exists.... more >>
How to enumerate embedded resources???
Posted by Bob Rock at 6/7/2004 4:00:37 PM
Hello,
I'd like to be able to enumerate resources in embedded .resources files like
it is possible with external .resources files using the ResourceReader
class.
Is there a way to do such a thing???
Bob Rock
... more >>
Localization in C#
Posted by SDK at 6/7/2004 3:39:49 PM
Hello,
I've written a little program in C# to test localization. It's one form
with a label and a button. I've included two languages into my form (Dutch
and English) using localization. In the main function, the culture is set
to dutch, and it all looks fine. But when I change the culture... more >>
Design question...
Posted by Mark Broadbent at 6/7/2004 3:30:05 PM
This is probably quite an idiotic question for some of you gurus but I'm
good at asking them :)
is it generally considered bad form for code in a private class procedure to
access private class variables?
Personally I don't see a problem with it, except that I've got this niggling
thing at the ... more >>
Datareaders crashing on null values
Posted by Lane at 6/7/2004 3:11:04 PM
SqlDataReader reader = command.ExecuteReader()
reader.Read()
Name.Value =(string)reader.GetString(1)
if this value is null it crashes, is there a way to determine if the value is null , or can the exception be handled or ignored??... more >>
Null Reference Exception
Posted by john sutor at 6/7/2004 3:10:37 PM
Can someone tell me the difference between the NullReferenceException and
the NullPointerException?
Also, please explain what they are.
... more >>
Obfuscate
Posted by RF at 6/7/2004 2:24:50 PM
Hi All,
I need some help from experts of preparing an application for obfuscation
and installation.
A solution with two projects:
1. I have a standard windows form app with an implemented custom
installer class.
2. I have a standard setup referencing the "output" of the above app a... more >>
HTML Parsing
Posted by SKG at 6/7/2004 2:24:28 PM
can any one help me with HTML Parsing Regular Expression or class.
I need to parse all href tags with <A> elements.
Thanks
... more >>
Printing a document
Posted by john sutor at 6/7/2004 2:21:17 PM
Does anyone know how to print a document. This should be simple. Here is
my code
I get a blank page
string sdoc="C:\\Test1.txt";
this.prtDocument.DocumentName=sdoc;
this.prtDocument.Print();
... more >>
Constant Struct in C#
Posted by QQ at 6/7/2004 2:20:14 PM
How do I declare a constant array of struct in C# ?
struct TEST
{
int x;
int y;
};
TEST[] test = { {1, 2}. {2. 3} };
The above doesn't compile. Any idea ?
... more >>
Fees to distribute a C# EXE?
Posted by guhar1 NO[at]SPAM yahoo.com at 6/7/2004 1:54:25 PM
I have come accross a posting saying that if you plan to develop an
application, with the C# language, and want to sell it as a product,
your customer will have to pay a fee for having the run-time
environment on their PC. Is that true? Cant the run-time environment
be bundle with the EXE? Shoul... more >>
Writing to an Embedded Resource
Posted by scott NO[at]SPAM krazyyak.com at 6/7/2004 1:51:00 PM
I have a simple text document embedded into an app I am writing. I can
read from it just fine via Assembly.GetExecutingAssembly(), but trying
to write to the resulting Stream throws an exception. The CanWrite
property on the Stream is false as well. Is there a way around this or
perhaps a better... more >>
Possible bugs in using [Flags] and Interfaces with Web Applications
Posted by Horia Tudosie at 6/7/2004 1:30:39 PM
Using Visual Studio 2003
This is to report a series of bugs regarding the FlagsAttribute and
(independently) the usage of interfaces in Web applications.
Let’s declare xColors type like:
[FlagsAttribute]
public enum xColors {
Red = 1,
Yellow = 3,
Green = 2,
Blue = ... more >>
Static methods
Posted by Simon Harvey at 6/7/2004 1:12:14 PM
Hi all,
I'm considering using a the micorsoft data access block as the main DAC for
my application. A colleage of mine suggested that I might have a problem
with concurrency though
When a method is static, do I need to worry about concurrency?
I figured that microsoft would have had this ... more >>
Regex help
Posted by Vai2000 at 6/7/2004 1:06:14 PM
Hi All, Can someone help me out with the syntax of a regular expression
which searches a string for the pattern
XYZ*
and breaks the contents on based of it.
Regex r = new Regex("XYZ*");
string[] s = r.Split(content);
doesn't work
TIA
... more >>
Multilingual support
Posted by ksmith NO[at]SPAM daktronics.com at 6/7/2004 12:54:04 PM
I have done multi lingual support in C++ and now I am trying to figure
out how to do in C#.
In C++, there were the string tables where you could enter text in
multiple languages, and now I want to have similar functionality in
C#. What is the equilvalent of string tables in C# resources?
A... more >>
create dynamic properties for an object.
Posted by Keshav at 6/7/2004 12:33:22 PM
Hi all
I have a Class "Sample" with following properties
PropertyA
ProeprtyB
ProeprtyC
I am binding the sample object to property grid so that i can edit the
proeprties.
Now in the above scenario i have to make ProeprtyC to be visible only if
proeprty B is set.
Pls advice me on th... more >>
convert code written without editor to editor compatible?
Posted by Billy Greening at 6/7/2004 12:25:38 PM
I have an application in C# that was written as a bunch of individual CS
files. I would like to combine these all into single solution that can be
editied with the Visual Studio 2003 editor. Does anyone have any tips on
how to quickly bring this code into the VS2003 environment? Below is a... more >>
VB.NET With analog
Posted by David at 6/7/2004 12:20:33 PM
What is the analog of With operator from VB.NET in C#?
... more >>
Using axWebBrowser in a C# form
Posted by Gilgamesh at 6/7/2004 12:11:04 PM
Hi there,
I'm trying to use axWebBrowser component, in a C# form, to connect to a web
server which requires Windows Basic authentication to login. Does anybody
know how to pass the logins to the axWebBrowser so it won't display a dialog
box to the user in order to enter the logins?
Thanks a... more >>
Refactoring for c# and vb
Posted by William Stacey [MVP] at 6/7/2004 11:36:50 AM
This is funny (if you not a vb programmer) :-)
http://www16.brinkster.com/messydesk/db/refactvb.asp
--
William Stacey, MVP
... more >>
Quick Question
Posted by Mike at 6/7/2004 11:35:11 AM
Hi,
I am using an enum to map to certain columns instead of using the string
name. When I use the enum as the indexer in a datarow it forces me to cast
it into an int. Shouldn't this be automatic at design time? See code
below:
private enum DataIndexer
{
OrderID,
SerialNumber
... more >>
What is the equivalent of data exchange in C#?
Posted by Reza Razavipour at 6/7/2004 11:17:51 AM
In a Windows Form, I have a control called MyEditC, an edit control. I want
to have a string variable that holds the string value of MyEditC. In C++,
this was done through DataExchange, DDX... and UpdateData calls. Does this
ring a bell?
How does one do it in C#?
Thanx,
Reza
... more >>
Performance: MFC app or C# Windows forms
Posted by nsoma007 NO[at]SPAM yahoo.com at 6/7/2004 11:05:04 AM
Hello Guys,
I know it is stupid to ask a question that which language/platform
gives better performance. My friend says that C# Windows forms MSIL
can beat MFC based GUI application any time in performance. Is that
true? If so, how does it acheive?
thanks
soma... more >>
Lowercase lettter in a string ?
Posted by Marlon R at 6/7/2004 10:32:43 AM
What is the fastest way to tell in string contains lower case letters?
... more >>
non-blocking queue review
Posted by William Stacey [MVP] at 6/7/2004 9:45:45 AM
Anyone care to comment on if this non-blocking queue implementation is
sound?
/// <summary>
/// Summary description for NonBlockingQueue.
/// Modeled after:
http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/queues.html
/// </summary>
public class NonBlockingQueue
{
Queue Q;
... more >>
object initialization ( easy ? ) File Stream
Posted by andrewcw at 6/7/2004 9:36:01 AM
I have a function that calls a function
FileStream findata
openCloseTextFileStream(xmldataPath,out findata,true,4,out errorMes); // get a loaded FileStream to use for ReadXM
if (errorMes.Length<1
ds.ReadXml(findata);
findata.Close()
What I do in openCloseTextFileStream is open excl... more >>
Get dataset new row primary key value
Posted by DotNetJunkies User at 6/7/2004 5:47:22 AM
How can I get after a dataset update the new row primary key value???
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.... more >>
advice about c#
Posted by Josema at 6/7/2004 5:11:05 AM
Hi,
I have a database with some world points with longitude and latitude..
I would like to show each point correctly into the image (for example a map of the whole word, and put every point in this map, like a map area
Do you have an idea of how its possible make this
Any advice
Thanks
Jos... more >>
ImageList
Posted by Michael C at 6/7/2004 4:54:13 AM
One more quick question. I am creating a form that uses an ImageList
control. I originally wanted to use a PictureBox control to display the
images in the ImageList, but it doesn't seem possible. I found a
work-around and used a Label to display, but I'm interested to know if the
PictureBox c... more >>
Optimizing SQL INSERTs from inside C#
Posted by Michael C at 6/7/2004 4:41:36 AM
I'm writing a program that, among other things, has to create and populate 7
tables on SQL Server. It reads in TAB delimited files, generates INSERT
statements and executes them. So far I've been able to optimize the program
by using the built-in streamreader and string functions (Split, Replac... more >>
Few questions about DataGrid...
Posted by Gidi at 6/7/2004 4:16:02 AM
hello
i have a DataGrid Table and i want to select a row by Clicking the mouse
after i tried few times, i understood the the only event the the datagird respones to is the current_cell_chang
and my code for this event was
private void dataGrid1_CurrentCellChanged(object sender,System.EventArgs ... more >>
Problerm on the conversion between int32 and byte[]
Posted by Stephanie Yao via .NET 247 at 6/7/2004 4:15:26 AM
Hi, I've done something on the conversion between int32 and byte[],here is my code:
1, I convert byte[] to an int:
int regInt = BitConverter.ToInt32(regBytes, 0);
this.tbRID.Text = regInt.ToString;//show int to the textbox
2, I convert the int back to byte[]:
int regInt = int.Parse(this.... more >>
Pack DLL with exe?
Posted by Du Dang at 6/7/2004 3:53:42 AM
Is there a way within visual studio to pack dll's into the exe itself?
I like my software to be contained within one file, because most of it is
really small. I can get away with it when I reuse classes by bringing the cs
files into the project. However when I have to use custom controls I have... more >>
Is there any iterator-like constructs for Streams?
Posted by Peter Rilling at 6/7/2004 3:25:52 AM
One nice thing about collections and arrays is that they implement the
IEnumerator and IEnumerable interfaces which allow for more then one
iterator to walk the list of items without affecting the position of the
other iterators. Is there a similar thing with streams? Is there anything
in the ... more >>
Problem changing Cursor property in a ListView control
Posted by Riccardo Giomi at 6/7/2004 2:41:03 AM
Hi
I would to display a Cursors.WaitCursor on a ListView control, so I tried
listView.Cursor = Cursors.WaitCursor
but it doesn't work at all, I see always the default cursor. The same thing happens if I set the WaitCursor in the properties window. The strange thing is that with other controls,... more >>
Remoting and net.sockets
Posted by Lloyd at 6/7/2004 1:06:04 AM
I have a question as to when remoting should be used as opposed to net.sockets.... more >>
|