all groups > c# > may 2007 > threads for monday may 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 31
Data Object should nt return DataView
Posted by Cralis at 5/7/2007 11:35:50 PM
In an attempt to sparate my database, business logic and GUI, I am
trying to have only my Data Object having database goodies. So, for
example, my GUI app wants to get a list of users to put ito a combo
box. It makes a call, 'GetListOfUsers'. The Business layer has a
function that would return a... more >>
Generic type converter class. Cant call static method of type T.
Posted by Steve Richter at 5/7/2007 9:56:17 PM
in a generic class, can I code the class so that I can call a static
method of the generic class T?
In the ConvertFrom method of the generic TypeConvert class I want to
write, I have a call to the static Parse method of the conversion
class.
if (InValue is string)
return T.Pars... more >>
How to compress a number of files into a one
Posted by ad at 5/7/2007 8:47:25 PM
Hi,
How can I compress(zip) a number of files into a zip file?
... more >>
How to transfer the following JAVA codes to C#?
Posted by fAnSKyer/C# newbie at 5/7/2007 7:23:36 PM
private void startupServer() {
try {
serverscoket = new ServerSocket(Listener.PORTNUMBER);
SERVER_ON = true;
} catch (IOException e1) {
e1.printStackTrace();
}
}
public void run() {
while (SERVER_ON) {
... more >>
Decimal seperator
Posted by Peter Larsen [] at 5/7/2007 6:36:27 PM
Hi,
How do i convert a string to float/double if the decimal-seperator doesn't
follow the local language settings ??
Eg.
string s = load a value from a file - "1234,12";
float f = float.Parse(s);
This will fail because my PC expect a dot - not a comma.
/Peter
... more >>
Creating a windows service with interface
Posted by Diego F. at 5/7/2007 5:57:11 PM
I need to make a windows service that shows the process in a window. How can
I add an interface to a windows service?
--
Regards,
Diego F.
... more >>
Read data file on client fails
Posted by Johnny at 5/7/2007 5:20:53 PM
Hi all:
I have an ASP.NET form that reads an Excel file and populates a datagrid. If
I load the form in IE on the server, and select a local file, the code works
fine. However if I load the form in IE from a client
(http://server/readexcel.aspx) and try to read a local Excel file, the file ... more >>
Updating listbox without refreshing window for each element added
Posted by Zytan at 5/7/2007 4:38:38 PM
In win32 there was a way to 'turn off' a listbox from updating until
you were done adding elements. Is there a way to do this in .NET?
Zytan
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Using Generic Class
Posted by Mel at 5/7/2007 4:28:21 PM
I have a few of this same basic class all the same except the name. Is it
possible to use generic to improve this?
Thanks
Mel
public class BaseFactors
{
private string name;
private double factors;
public double Factors
{
get {... more >>
IDE Code Templates
Posted by Phil Barber at 5/7/2007 4:07:32 PM
does VS2005 have code templates?
for example in the editor one might type: "fore" and then the spacebar
and then it would be replaced with
foreach(var $ in $)
where the "$" are tab stops and the cursor is positioned at the first $,
you use the tab key to cycle through...
phil.
... more >>
best db wrappers?
Posted by not_a_commie at 5/7/2007 4:04:04 PM
What are the best C# (.NET) wrappers for these databases?
MySQL 5
PostgreSQL 8.1
Sqlite3
By best I mean maintained, functionally complete, fast, C# naming and
DB standards, documented...
Thanks.
... more >>
determine local access
Posted by Frank at 5/7/2007 3:57:30 PM
Hello,
is there a way to determine someone is locally accessing the webpages
(localhost\index.aspx) in an ASP.NET environment? As opposed to from a
remote place (ie. 555.123.3.45\index.aspx).
Thank you
Frank
... more >>
ArrayList vs. List<>
Posted by Zytan at 5/7/2007 3:52:35 PM
The docs for List say "The List class is the generic equivalent of the
ArrayList class." Since List<> is strongly typed, and ArrayList has
no type (is that called weakly typed?), I would assume List<> is far
better. So, why do people use ArrayList so often? Am I missing
somehing? What's the ... more >>
MDI child window Icon size
Posted by Rainer Queck at 5/7/2007 3:41:44 PM
Hello NG,
what are the right dimensions for a window icon, used on a mdi child window?
My Problem:
I used a third party Icon-Designer to design some icons for my application.
Those icons look ok on a mdi child as long as it is not maximize.
As soon as I maximize the window, the Icon is pla... more >>
Repost: VS2005 - is DataGrid.IsSelected( ) broken ? (still an MS 'managed' group?)
Posted by frostbb at 5/7/2007 3:16:55 PM
The following code works great in C# Net 1.0 & Net 1.1 apps ... doesn't work
for Net 2.0 apps.
Cannot get pDg.IsSelected(i) to toggle to 'true' for 'highlighted' rows in a
DataGrid control.
private int CountSelectedDataGridRows(DataGrid pDg)
{
int i = 0;
... more >>
Connection to Access database on Web Server from VB Winforms application
Posted by Johnny Jörgensen at 5/7/2007 2:20:39 PM
Does anybody know if it's possible to do a Windows application that can read
and write to an Access databas located on a web server that only accepts DNS
connections.
Has anybody got a code example for that and/or tips?
TIA,
Johnny J.
... more >>
Invoking Generic Methods with Generic Arguments
Posted by Suds at 5/7/2007 2:02:14 PM
Hi,
I'm having an issue with invoking a Generic method that takes Generic =
Arguments.
My method signature is=20
public void GenericMethodWithGenericArguments<E, V>(List<E> =
theFirstList, List<V> theSecondList);
I pass the name of the method, the arguments for the =
"GenericMethodWithGen... more >>
RegEx.Replace() to remove double-backslashes in a path
Posted by randy1200 at 5/7/2007 1:58:01 PM
OpenFileDialog gives me the following, which I place in tbDevPath.Text:
x:\\myVob\\mySolution\\mySolution.sln
I really need this path to be single-backslashes, not double-backslashes, so
I tried the following:
string updatedDevPath = Regex.Replace(tbDevPath.Text, @"^\\\\$", "\\")
This ... more >>
Handling the Red X button
Posted by melon at 5/7/2007 1:50:00 PM
Hello,
Is there anyway to force the application to handle the Red X button
differently? I cannot use a generic Closing event as it will prevent
the system to shut down properly. I hope that, when clicking on the
red X button it will only minimize the window, or just hide it.
... more >>
HttpWebRequest, Error 400 - Possible redirect?
Posted by bepnewt NO[at]SPAM gmail.com at 5/7/2007 1:16:58 PM
Hello!
I'm trying to connect to different sites using an HttpWebRequest
object and some of them return an Error 400. If you navigate to it in
a normal browser, it works fine. This is an example of one:
http://www.nmprc.state.nm.us
Error: The remote server returned an error: (400) Bad Req... more >>
Is KeyValuePair<string,string>.ToString intended as serialization building block?
Posted by Steve Richter at 5/7/2007 12:59:15 PM
KeyValuePair<string,string> has a ToString method that returns the
KeyValue pair seperated by a comma and enclosed in [ ]:
[ name, Jane ]
Is this method used as a building block for serialization?
The reason I ask is because I dont see a "FromString" or "Parse"
static method that takes a ... more >>
Does that RegExp makes sense to you, people?
Posted by yoni NO[at]SPAM nobhillsoft.com at 5/7/2007 12:00:35 PM
Hi,
I am trying to write a regexp to find all the code on the header of
entities in SQL Server (views, SPs, etc...) I got something like this:
(.|\n)*((create view)|(create proc)|(create function)|(create
trigger))
does that means sense? I want all the code that's before the code
header. n... more >>
Where and how to use the EXTERN
Posted by Victor at 5/7/2007 11:49:02 AM
Hi,
Am a novice in c#, tell me about how and where i can use "Extern" Keyword
with some good example
Thansk
--
---------------------------------------
Knock you down in first round... more >>
Multiple handlers for an event
Posted by Dom at 5/7/2007 11:42:57 AM
In CSharp, can you have multiple handlers for a single event? For
example, for a textbox TextChanged event, can I have two separate
handlers called up? I have 4 text boxes, and the TextChanged events
all go to the same handler, but I want one of them to go to a separate
handler also.
This i... more >>
What's wrong with Private keyword
Posted by Private at 5/7/2007 11:25:01 AM
Hey,
Can some one tell me about what's wrong with the following code and what is
the solution with some meaningful correction
-----------------------------
class Program
{
static void Main(string[] args)
{
int x, y;
Console.WriteLine("Enter 2... more >>
Accessing Parameter Value with Attribute
Posted by Larry R at 5/7/2007 11:20:33 AM
Is there any way to use a custom attribute class to use a parameter of
the tagged method?
For instance,
[LogThis ( user) ]
public TagThis ( string user )
{
....
}
Larry R
... more >>
Adding a tray icon for a console app?
Posted by melon at 5/7/2007 11:09:17 AM
Hello,
I have written a console application, but now I would like to add a
notify icon in the system tray. What is the easiest way to do it? It
would be painful if I have to convert it to a Windows App.
Thanks.
... more >>
GridView not displaying data even Reader object contains Rows
Posted by weird0 at 5/7/2007 10:53:59 AM
The property of GridView1.HasRows is true and after assigning
GridView.DataSource=reader, it does not display any records in the
GirdView.
I am i missing out something? Here is the code:
protected void Button1_Click(object sender, EventArgs e)
{
int AtmtransId=-1;
if (Se... more >>
Using SetPixel
Posted by Seabass at 5/7/2007 10:48:39 AM
Hello everyone,
I have to do an image viewer for an exotic format so I want to know
how to place pixels somewhere on the form or on some object.
I tried doing this but it works incredibly slow.
{
Bitmap bmp = new Bitmap(this.Width, this.Height);
for (int i = 0; i < this.Width; i++)
... more >>
Reading a file byte by byte
Posted by Seabass at 5/7/2007 10:42:54 AM
Hello everyone,
I'm trying to do a Hex Viewer in C#. I'm reading the user selected
file byte by byte but it seems to take forever ( one minute to read a
larger file ). Is there any way to make this function work faster ?
Here is my code:
/// <summary>
/// Opens a file cho... more >>
Start User Process from Local System Service
Posted by SugarDaddy at 5/7/2007 10:32:24 AM
Here's my problem.
I have an NT service (really a .NET service) running as local system.
I have a .NET form running on the user account. The form and the
service communicate via an IPC Channel so the form can control the
service and do various things. Both applications share the same set
of... more >>
Pinvoke help
Posted by Ringo at 5/7/2007 10:03:12 AM
the LeafProject http://www.leafproject.org has a DLL for Face
recognition. it is written in C++ but they interface to it from Lisp.
I want to interface to it from C#.
Their Lisp definitions looks like this.
;;;; REGISTER THE VISION FACE RECOGNITION
DLL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(fli:re... more >>
multi threaded database access...
Posted by Rogelio at 5/7/2007 8:30:02 AM
hey, I have 2 threads, th and th2, both of them run a method.
each of these 2 methods requires database access.
sometimes I get an error, that database requires an open connection, and
that the current connection state is "connecting".
is this because both threads are trying to use the sa... more >>
Scanning byte arrays
Posted by Vince Panuccio at 5/7/2007 7:26:30 AM
Hello,
If im looking for a pattern of byes in a byte array, what would be the
best approach?
I could convert the array into a string and use IndexOf recursivly by
remembering the last position I encountered a match, but it seems to
be the wrong way to go about it, especially if I have an ar... more >>
Passing a TabPage as a parameter
Posted by Dom at 5/7/2007 7:21:19 AM
I have 5 TabPages, and I pass one of them to a procedure. How do I
know which page I have?
All I can think of is using the Name property of the TabPage.
void SetPage (TabPage t)
{
if (t.Name = "tabFirst") {...}
else if (t.Name = "tabSecond") {...}
}
... more >>
GETs and SETs
Posted by Dom at 5/7/2007 6:58:14 AM
I understand that best practice is to hide fields behind methods, but
for the hundredth time, I've written the following:
get { return x; }
set { x = value; }
If that's all that get and set does, isn't it better to just make "x"
a public member?
... more >>
How to install service in Vista
Posted by Joachim at 5/7/2007 5:36:01 AM
I have made a Windows Service and I have read that you should use
installutil.exe to register the service. However, no service appears in the
Control Panel > Administrative Tools > Services when I run installutil. How
can I install my service?
I get one message when using installutil that I... more >>
Duplicate code finder.
Posted by WardB at 5/7/2007 5:00:40 AM
Hi,
I'm looking for an app that can find duplicate code within a large
solution. I found something like Simian (see also
http://blogs.conchango.com/howardvanrooijen/archive/2006/02/08/2776.aspx),
but I am looking for (free-ware/open source ) alternatives, as Simian
is not for commercial proje... more >>
cannot get a ref parameter on a thread
Posted by Diogo Alves at 5/7/2007 4:48:00 AM
Greetings,
I have a COM reference that connects to a device to get some data... if I
don't use threads to get data i can get the "ref int events" without any
problems but if it's running inside a thread it doesn't touch on the
variable value
How can I workaround this?... more >>
important quey
Posted by bushi at 5/7/2007 1:41:09 AM
hi every one!
i have designed the interface of an application using a
form.there are some controls added to the form.when i maximize the
form,the controls remain of the same size as before,i want they should
maximize too.any one have idea about it plz rply,i'm waiting for any
sol... more >>
struct size error
Posted by guy.gorodish NO[at]SPAM googlemail.com at 5/7/2007 12:26:41 AM
hi,
i have a struct in c# that is containing Int32 member and Double
member.
when i try to get the size of it i get size of 16 bytes, while i was
expecting to receive 12. (Int32- 4 bytes, Double - 8 bytes)
does anyone have any ideas why it occur?
... more >>
self-confidence of compiler
Posted by valentin tihomirov at 5/7/2007 12:00:00 AM
fDeleted = false;
uint jobId;
foreach (Struct struct in structures) {
if (struct.type == JOB) {
jobId = struct.id;
if (struct.dataType == STATUS)
fDeteted = (struct.data & STATUS_DELETED) != 0;
}
if (fDeleted)
writeln(jobId + " has completed");
Not... more >>
How to create and use chm-file for online help?
Posted by Rainer Queck at 5/7/2007 12:00:00 AM
Hello NG,
I am currently confronted with the task to equip a vs2005 project with
context sensitive online help (F1).
Reading through the MSDN-Library I found out about the "HelpProvider" class,
which lets me use a chm help file for this purpose.
My question now is, how can I generate a ch... more >>
How to save a string as a text file.
Posted by ad at 5/7/2007 12:00:00 AM
How can I save a string as a text file to disk?
... more >>
How to *force* threads to run on certain processors?
Posted by Jon B at 5/7/2007 12:00:00 AM
Hi There!
We have 2 processor server (Not dual core, actual seperate processors).
Is it possible from .NET to force some threads to run on certain processor
(say on processor #2)? For instance, run UI stuffs on processor #1 and run
other background stuffs on processor #2.
Possible?
T... more >>
|