I need to serialize a singelton in my system.
It is possible to serialize with BinaryFormatter or SoapFormatter using ISerializable
and a helper IObjectReference class. But, what I'm after is plain-jane XmlSerializer
support.
Is there any way this is possible?
Chris
---
using Syste...
more >>
WYSIWYG Editor ASP.NET
Posted by Steven Nagy at 1/18/2006 5:22:05 PM
Hey all,
I just installed VS2005.
I am wondering if it comes with some sort of WYSIWYG control.
I want to create a website where all the content is editable through
some admin panels.
I had heard that VS2005 has a web control for this, but I can't find
it.
I just need it to render HTML, but...
more >>
Generics Syntax help
Posted by AdamH at 1/18/2006 5:22:03 PM
Anyone know if you can have an OR type of contraint in the where clause?
Psudo example
Void MyMethod<T>(T list, string b) where T:interface1 OR interface2 {}
Does that make sense? ( T should implement at least one of the interfaces (
interface1 and/or interface2 )
...
more >>
How to clear all TextBox in a Windows Form?
Posted by Jason Huang at 1/18/2006 5:16:52 PM
Hi,
In my C# Windows Form MyForm, it has many TextBoxes, e.g., txtName, txtID,
txtAddress, ...,
it also has many ComboBoxes, e.g., cboState, cboGender.
How do I clear all those controls's Text in a function? Is it possible to
do it in foreach loop?
Thanks for help.
Jason
...
more >>
try finally Error Handling without catch
Posted by A.M-SG at 1/18/2006 4:48:13 PM
Hi,
I underestand that we can use try finally without catch clause. Something
like this:
try
{
throw new Exception("Test")
}
finally
{
// close all files
}
What exactly is this?
Thank you,
Alan
...
more >>
Given an 'event', how do I obtain underlying delegates ?
Posted by The One We Call 'Dave' at 1/18/2006 4:31:00 PM
Hi,
Various custom controls in my WinForms application register for the
'Application.Idle' event on load, and unregister on dispose. To avoid memory
leaks, it's essential that I remember to unregister on dispose.
Before my application exits, I'd like to do an 'assert' to assure mys...
more >>
Excel to SQL server
Posted by Ed Chiu at 1/18/2006 4:16:04 PM
Hi,
I am looking for ways to import multiple Excel files in a local hard drive
into SQL Server database. Can somebody give me some pointers?
I would prefer to do this in C# Windows Application, knowing that DTS can
probably give me what I want.
TIA...
more >>
Insert and update don't work
Posted by Diana Estrada at 1/18/2006 4:15:30 PM
Hi, I have a store procedure to insert , and I use tableadapter to
execute this store procedure, when I run the application and execute the
sp , works ok
and after I see the datagridview and the new row is there, but the
problem ir that when I stop the application and look my database in SQL...
more >>
Deployment
Posted by INeedADip at 1/18/2006 4:09:32 PM
How do I deploy a website?
I keep getting a bunch of *.pdb files for all my other libraries.
I went into Build/Configuration Manager and changed it to Release, then I
just re-build my website and went to Build/Publish Web Site.
I still get all the debug files? What am I missing?
...
more >>
"Cross-thread operation not valid" even when .InvokeRequired is false
Posted by Mesan at 1/18/2006 4:09:11 PM
I'm getting a "Cross-thread operation not valid" Exception and I can't
figure out why.
I've got a BackgroundWorker that creates a UserControl with a whole lot
of other user controls inside of it, full of data I'm getting from the
database. When my background worker completes I take e.Result a...
more >>
Add sizegrip to control or dialog?
Posted by Mark Ingram at 1/18/2006 4:05:20 PM
Hi, ive got a form which has FormBorderStyle set to None. Im using
regions so i need to draw and paint my own custom window shape. But i
still want the user to be able to resize, so how do i draw the standard
sizegrip onto my form?
Thanks,...
more >>
Problem with Focus()
Posted by james at 1/18/2006 3:59:16 PM
I have several Popup Windows Forms which have a TextBox at the top that I
want the cursor to Focus too when the Form comes up. I am using the
standard control.Focus() but I cannnot seem to get the control to actually
receive the focus. I place my code both in Form_Load and in Form_Activated....
more >>
Sqlclient - connection pooling
Posted by Antimon at 1/18/2006 3:48:29 PM
Hi,
I'am working on an asp.net web project. was looking at some sources and
as i can see ppl creates new "sqlconnection" instances for each query
(or for every module). I know there's a pooling mechanism but isn't it
better to have a connection created at "page_load" and closed when
request h...
more >>
using clause with a "variable" assembly
Posted by Kevin Frey at 1/18/2006 3:10:18 PM
Is it possible to get c# perform a using statement where the namespace for
the using is not specified literally but instead comes from a variable, a
token, a predefined value etc.
We have numerous auto-generated assemblies that represent specific database
models within a database, but each ...
more >>
Replace Default Application Icon
Posted by quest at 1/18/2006 2:25:22 PM
I created windows application using C#. I tried to replace the default
application icon by replacing the app.ico file in the project directory but
the application still load the old icon. Can someone helps ? Thanks.
...
more >>
Custom control "invalid property value" dialog
Posted by Mark Ingram at 1/18/2006 2:03:00 PM
Hi, ive written a custom control and i would like to display the
"invalid property value" dialog box for certain properties on my form if
the user enters a value outside the allowed range (in the visual studio
designer).
e.g. If i had a percentage property, i would want the user only to b...
more >>
Common method of using tab control?
Posted by Brett Romero at 1/18/2006 1:11:53 PM
I have a tab control with seven tabs. I need to do certain things when
a user clicks each tab. I'm doing this:
private void tabControl1_Click(object sender, EventArgs e)
{
if(tabControl1.SelectedIndex == 0)
{...do something...}
else if (tabControl1.SelectedIndex == 6)
{...do something...}...
more >>
Can I Use HTML Text Writer i a Custom Control to Render the <head> Section?
Posted by Frank at 1/18/2006 12:46:57 PM
From: "Frank" <fkaesser@pfmail.com>
Subject: Can I Use HTML Text Writer i a Custom Control to Render the <head>
Section?
Date: Wednesday, January 18, 2006 11:38 AM
I would like to create a custom control that generates everything that will
be in the <head> </head> section.
This would al...
more >>
Right-align a number?
Posted by Hans Kesting at 1/18/2006 12:30:47 PM
Hi,
Can I right-align a number with leading *spaces*?
F.i. I have the value 2 and I want to display it as " 2".
int num = 2;
string s = num.ToString("00"); // gives "02", but I don't want the "0"
s = num.Tostring("#0"); // gives "2" - no leading space
s = num.ToString().PadLeft(2); // wo...
more >>
Activate minimized form
Posted by Dave Booker at 1/18/2006 12:10:08 PM
I have a Windows form application that I generally run minimized. When a
critical event occurs it instantiates another "Alert" form which I want to
grab the user focus.
In the Alert constructor I call both this.Show() and this.Activate(), but if
the parent application is minimized then the...
more >>
Draw rounded rectangle inside a specific area
Posted by Mark Ingram at 1/18/2006 12:09:44 PM
Hi, how can i draw a rounded rectange, with a border within a specified
area?
i.e. if i have a Rectangle with width and height of 100, how can i draw
a rectange with 2 pixel border inside of the original one? (the current
attempts all draw the border just outside of the original rectangle)....
more >>
Regular expression question
Posted by David McCollough at 1/18/2006 11:49:17 AM
I am trying to formulate a regular expression that would not allow strings
such as the following to be entered.
XXXXXXXXXXXXXXXX
AAAAAAAAAAAAAAA
BBBBBBBBB
Basically any repeating character > 2 of the same character.
I have tried several things and I can't seem to get it to work.
Any ...
more >>
what do you prefer ?
Posted by Jarod at 1/18/2006 11:38:36 AM
Hey
I don't know what's best. I can invoke 20 times stored procedure with
diffrent id's to do something. Or put this id's as one long varchar string
and in stored procedure use some userDefined function to cut it into single
peaces. What's better way ? It seems like the second one ;)
Jarod
...
more >>
Generate hash code
Posted by mortb at 1/18/2006 11:38:30 AM
Hi,
How do I write a GenerateHashcode function that will generate guaranteed
unique hashcodes for my classes?
cheers,
mortb
...
more >>
Can I Use HTML Text Writer i a Custom Control to Render the <head> Section?
Posted by Frank at 1/18/2006 11:38:26 AM
I would like to create a custom control that generates everything that will
be in the <head> </head> section.
This would allow me to make changes on all pages withing a site in one
location.
But can I do so since the control would not be withing a <form> tag in the
aspx page?
Can I do...
more >>
how can i return null when returning a struct
Posted by Digital Fart at 1/18/2006 10:55:22 AM
I have the following function that returns a struct
public struct layout
{
public string str;
public int i;
}
function in some class where i loop through an arraylist of structs
public layout getLayout(string s)
{
foreach ( layout l in layoutArray)
if ( l.str == s ) return l;
...
more >>
Using a VB6 ocx in C# .net
Posted by omar.torres NO[at]SPAM gmail.com at 1/18/2006 10:13:32 AM
Hi all,
Currently I have a VB6 application which uses a custom OCX. To use the
ocx in my VB6 application, I used the following code:
Public MyOCXInstance As OCXobject 'Create a new instance of the OCX
.....
Function read()
Dim MyString as string
MyOCXInstance.read(MyString)
.....'Valid...
more >>
resx files and multi language support??
Posted by perspolis at 1/18/2006 10:08:55 AM
Hi all
I wanted to know when I create a form ,Where does The VS.Net keep string
literals on form??
I want to have a form for some languages..Do I have to design a form for
every language?or can I have better way?/
please help me
thanks
...
more >>
Forcing the dotted rectangle on a button?
Posted by melanieab at 1/18/2006 10:05:46 AM
Hi,
Before I go into detail, is there any way to force a button to get that
dotted box on it that shows it's in focus? Just saying btn1.Focus(); isn't
working for me. Btn1 is definitely the thing being focused on, but you
wouldn't know by just looking at it. And it seems that the only way to ...
more >>
DataGridView Performance issue
Posted by FX at 1/18/2006 9:55:03 AM
Hi all,
I'm using a CLR 2 component DataGridView and I'm encountered Performance
issue.
Here is the snippet :
string valueStr = value.ToString();
DataGridViewRowCollection rows = dataGridView1.Rows;
foreach (DataGridViewRow dataGridViewRow in rows) {
dataGridViewRow.Cells[0].Value = valu...
more >>
Windows 2000 Pro
Posted by aladdinsgenie at 1/18/2006 9:23:45 AM
When I installed Win 2000 Pro last week, I forgot to disconnect my
portable drive hub therefore my hard drive designation was changed from
"C" to "J", now I cannot install my new scanner, as it keeps looking
for the drive "C". What can I do short of reformatting my drive to get
this drive named...
more >>
object projection
Posted by Adam Wawrzyniak at 1/18/2006 9:22:32 AM
Hi,
this is my problem:
-------------------
public class Rectangle : Shape
{}
....
Shape shape;
shape = graph.AddShape(uid, pointXY);
----------------------------
AddShape returns a Shape object but in fact that is a Rectangle object, how
do I project it to this class in order to use Re...
more >>
How distribute files with VS2005 Win app?
Posted by Ronald S. Cook at 1/18/2006 9:17:31 AM
Hi all,
We've created a VS2005 Windows application. We're using "ClickOnce" that's
built in to deploy the app. However, we want to also send with the install
a folder of data files that the end user will need. Can ClickOnce
incorporate this? If not, how can I accomplish this need?
...
more >>
get data from detailsview
Posted by Dave at 1/18/2006 9:02:05 AM
I have a detailsview connected to a SqlDataSource. I have a button on a form
that needs to take some of the data from the detailsview and do some stuff
with it. Is there anyway to get the data from the detailsview?
Thanks in advance....
more >>
Problem using DIB handle with C++ DLL
Posted by Geoff Tanaka at 1/18/2006 8:47:04 AM
Hi, I have created a DIB in C# and I am having a problem using it in a
C++ DLL.
Basically I have a C++ DLL which requires a DIB handle to be passed
into it. I create the DIB using:
IntPtr myDIB = CreateDIBSection(hdc, pBitmapInfo, DIB_RGB_COLORS,
&pPixelSource, (IntPtr)0, (uint);
I can put...
more >>
Assembly class changed without keeping compatibility in .NET 2 ?
Posted by WT at 1/18/2006 8:41:55 AM
Hello,
I am migratingcode from .NET 1.1 to 2 (Raibow project) and in this code we
where storing assembly name in database just to be able to load it
dynamically later.
Code in the register method was
// Get Assembly name
string assemblyName = portalModule.GetType().BaseType.Assembly.CodeB...
more >>
datagrid or table?
Posted by robert.colclough NO[at]SPAM gmail.com at 1/18/2006 8:31:47 AM
Hi
I'm trying to write a program that seraches from strings in various
text files and displays the data in an easy on the eye tabular form on
a webpage. I have written all of the code to search through the files
in question but I need a bit of help on how to display them.
The datagrid on th...
more >>
Patters and practices
Posted by DBC User at 1/18/2006 8:27:12 AM
Hi All,
I am trying to write a tray icon process using c# before I do that, I
would like to know if there are any thing I should be aware of and is
there a block for doing this?
All this does it to listen to a queue or an xml file (not decided yet)
and when ever an entry is made it will sta...
more >>
Hide balloon tip icon
Posted by Dave Booker at 1/18/2006 8:22:08 AM
I create a balloon tip in the system tray using:
notify.ShowBalloonTip(10000, "Text", "More Text", ToolTipIcon.Info);
After the time expires I want the icon to go away. The balloon disappears,
but I can't reliably get rid of the icon. What's the right way to do that?...
more >>
BitArray question
Posted by Rainer Queck at 1/18/2006 8:19:46 AM
Hi NG
I have some questions concerning BitArrays.
Assumption : BitArray with 16 Bits
Is it possible to "load" a BitArray with a UInt16 Value with out iterating
it like:
UInt16 Bits = 0xAA55;
for (int i = 0 ; i<16 ; i++){
MyBitArray[i] = (Bits & Mask) >0 ;
Mask <<= 1;
}
and...
more >>
Getting and Setting the network settings.
Posted by UJ at 1/18/2006 7:41:51 AM
I had already asked how to get the network settings on the machine and was
told that I should use the WMI interface. I downloaded programs that will
allow me to look at the stuff but I'm not sure which items are the correct
ones to get.
Can anybody give me a direction on where I look to fig...
more >>
Office Picture insert ? Example
Posted by Fabian at 1/18/2006 7:17:02 AM
Hi all,
I need an example to insert an Picture in an opend Word Document. My Code
doesn t work.
I tried :
object vk_missing = Type.Missing;
wordapp.Selection.Range.InlineShapes.AddPicture(@"C:\logo.bmp", ref
vk_missing, ref vk_missing, ref vk_missing);
The Document is successfully o...
more >>
Viewing Web Page from windows form.
Posted by JohnSouth at 1/18/2006 6:37:57 AM
Hi
I'm sure I'm missing the obvious but I want to put a control on a
windows form into which I can load a web page, view only, nothing
complicated. I'm using Visual C# 2003.
Can someone give me a hint.
Cheers
John South
www.WhereCanWeGo.com
Pangbourne UK
...
more >>
Viewing Web Page from windows form.
Posted by JohnSouth at 1/18/2006 6:37:41 AM
Hi
I'm sure I'm missing the obvious but I want to put a control on a
windows form into which I can load a web page, view only, nothing
complicated. I'm using Visual C# 2003.
Can someone give me a hist.
Cheers
John South
www.WhereCanWeGo.com
Pangbourne UK
...
more >>
how to inherite a class from System.windows.form.MessageBox?
Posted by harvie wang at 1/18/2006 6:22:07 AM
Hi,
I want to add more buttons to messagebox, such as "Apply All".
Can i implement a custom messagebox, inherite from System.Windows.Form.MessageBox?
Best wish,
harvie
2006-1-18
...
more >>
Running nant to compile csc project
Posted by emferrari NO[at]SPAM gmail.com at 1/18/2006 6:09:28 AM
Hi all
I have a cs project that contains a reference to the MSI.DLL. If I open
the project manually into the VS.NET it compiles fine, but when it runs
against nant it fails. The error is regarding missing namespaces that
are into the MSI.DLL.
Here is my nant command:
<?xml version="1.0"?...
more >>
config file change at runtime save??
Posted by Iwan Petrow at 1/18/2006 5:37:36 AM
Hi,
I have dynamic properties (for checkboxes Checked property which I use
in Option dialog box) . After I change checkboxes check properties I
use DOM to save the changed values in the config files (it works fine -
it changes the values). But if I reopen the option dialog (I create
new one ...
more >>
Datatable Primary Key not being set from Xml Schema
Posted by Emma Middlebrook at 1/18/2006 5:33:49 AM
Hi there,
I have created an XmlSchema to represent the tables in my database and
I have specified a primary key for each of the tables.
However, to be able to execute the following code:
DatabaseTables.CategoryInfoRow categoryRow =
m_dtCategories.Rows.Find(selected.category_ID) as
...
more >>
config file name
Posted by Iwan Petrow at 1/18/2006 4:51:46 AM
Hi,
I use Net Framework 1.1 and windows forms.
How could I take the name of the configuration file at runtime?
Thanks.
...
more >>
Meesage Queue
Posted by Macca at 1/18/2006 4:31:04 AM
Hi,
I have a desktop application that i would like to design a message handler
into.
Data comes into the app over ethernet which i obtain through a TCP Server on
my PC. I want to take each packet of data and buffer it in a message queue.
Another thread in my app will take each message of...
more >>
PrintPreviewControl
Posted by gsb58 NO[at]SPAM hotmail.com at 1/18/2006 4:18:15 AM
Hi!
I seem to be missing something when using the PrintPreviewDialog.
On a form I have a monthCalendar which, at runtime, will display all
months of the year. Now I have routine for printing the calendar and it
works fine. However, when I try to bind this object to the
PrintPreviewDialog, t...
more >>
Adding a "Select" option to a databound dropdown
Posted by Simon Harvey at 1/18/2006 3:41:30 AM
Hi all,
I have to use drop downs in a number of places in my applications. These
drop downs are databound but I can't seem to see how to add a new item (eg
"Select" or something like that) to the beginning of the drop down.
I obviously dont want to have to put dodgy data like that in the d...
more >>
about the probing tag and assembly location
Posted by Shiraz at 1/18/2006 3:40:02 AM
Alright, I think I have a better perception of assemblies and environment
variables now. The question I had initially posted was pertaining setting of
environment variables using the VSI installer. This was presumed essential
for specifying the paths to certain dlls. Subsequently, the idea was...
more >>
Serial communication problem with Framework 2.0
Posted by Lonifasiko at 1/18/2006 3:22:23 AM
Hi,
I've been able to communicate using HyperTerminal with my device via
serial port COM1. I just send a command and device switches on. I just
need that to start playing with it. This way, I understand device and
serial communication work wihout problems.
Now I want to do the same with C# ...
more >>
Filling a datagrid from Oracle
Posted by gillcleeren NO[at]SPAM google mail DOT com at 1/18/2006 2:37:23 AM
I have a datagrid that has to be filled in a WinForms application. The
data comes from an Oracle database.
The normal procedure would be filling a dataset, but I have the problem
that there are over 100.000 records in the tables, so this has very low
performance when executing.
I then tried...
more >>
Help for compiling
Posted by delphine_fontaine NO[at]SPAM yahoo.com at 1/18/2006 2:37:07 AM
Hello,
I have a projet for smartphones which I can't build. In fact, I have
this error :
The type or namespace name 'ISupportInitialize' does not exist in the
class or namespace 'System.ComponentModel' (are you missing an assembly
reference?)
I'm using "Visual Studio .Net 2003", a compact ...
more >>
syncML and C#
Posted by qweer at 1/18/2006 2:14:39 AM
I want download all contacts from my mobile phone to my computer. I have to
use usb (or bluetooth) interface and syncML. Someone has any examples or
tutorials, how could I do this. (how can use syncML. Do I have to send only
xml file to phone throught usb? what will I receive?)
...
more >>
Create IDE
Posted by raja_svks at 1/18/2006 1:46:54 AM
I want to create one IDE like visual studio. Not with all the features,
but with features like intellisense, syntax highlighting like that..
I dont know, how to start with. Can you please guide me in this?
Raja Pandian
...
more >>
Need advice for tracking down a general network error exception
Posted by Alan Pretre at 1/18/2006 1:19:50 AM
I have an application installed at a customer site that has been getting a
general network error for a couple of years. I was hoping that .NET 2.0
would clear it up, but unfortunately it didn't. The .NET 2.0 exception does
give a little more info than .NET 1.1 did, but not much.
Can anybo...
more >>
list of dbf tables from odbc connection
Posted by Martin at 1/18/2006 12:07:14 AM
Hello
Using c#, is there a way to get a list of table names from odbc dsn dbf
database connection?
Thanks
Martin
...
more >>