|
poodull wrote:
so there's no obvious reason to make an event virtual.
Except I would think that making an event virtual means that you want to overload it's add and remove accessors.
public event Event1
{
add
{
}
remove
{
}
}
So if someone add's an handler you may want to keep a count or something like that.
|
|
|
|
|
Hello!
Using SMTPMail class to send mail.. Having problem with finding out how to find host name of the server that I am running on... If I am typing host name myself -- it works, but I am not expecting user to know what to type...Can I find it automatically?
Please help!
|
|
|
|
|
in short: NO, but if you know there ISP, u could hardcode it into your program.
|
|
|
|
|
try running from the command prompt :
netsh diag show mail , the output is the default configured pop3/smtp servers
works only on win2k and xp
|
|
|
|
|
Hello Friends,
I am using following code to get the information about the table in access database :
string con = "Provider=Microsoft.JET.OLEDB.4.0;data source=C:\\Documents and Settings\\Kalpesh\\My Documents\\trialdb.mdb";
String query = "Select * from Emp";//'Emp' is tablename
DataTable accessDataTable = new DataTable();
OleDbConnection dbConn = new OleDbConnection(con);
conn.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand(query, dbConn);
adapter.Fill(accessDataTable);
foreach(DataColumn dataColumn in accessDataTable.Columns)
{
columnHeaderValues.Add(dataColumn.Caption);
}
Actually, I want to get names of all tables present in access database.So, that I can get the information
of tables dynamically.
Anyone knows the solution??
Thanks in advance.
Pranoti
|
|
|
|
|
Have a look on MSDN for SQLTables.
Quote:
"Summary
SQLTables returns the list of table, catalog, or schema names, and table types, stored in a specific data source. The driver returns the information as a result set.
"
|
|
|
|
|
What you want is the tables schema rowset...
<br />
OleDbConnection conn = new OleDbConnection();<br />
<br />
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; ...etc. ";<br />
conn.Open();<br />
<br />
DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,<br />
new object[] {null, null, null, "TABLE"});<br />
<br />
foreach (DataRow table in schemaTable.Rows)<br />
{<br />
}<br />
conn.Close();<br />
|
|
|
|
|
Thank you very much for your help.
'OleDbSchemaGuid.Tables' contains both tables as well as views of the database, but with the way suggested by you we can get only tables.
I've tried for getting View, with the second argument of GetOleDbSchemaTable like this...new object[] {null, null, null, "VIEW"}. It is working perfectly.
But for that I'll have to repeat the call twice, onc for table and another one for view. Is there any way to get both tables as well views in one call.
Thanks.
Pranoti
|
|
|
|
|
Hi, I've got a bit of a problem with using a data grid in a window application. The application crash if I try to double click on the resize row height cursor. ie. When my cursor is in between two row headers and the cursor becomes the resize cursor. Usually, when you double click in between columns, it automatically resize the columns. However, when I try to do the same with the rows, it crashes with this error message: "Fatal system error has occured. Index was out of range. Must be non-negitive and less than the size of the collection. Parameter name: startIndex, mscorlib"
Is there anyway I can disable the feature of allowing the user to resize the rows??
Thanks in advance.
|
|
|
|
|
Have you tried overriding the OnResize?
Rocky Moore
|
|
|
|
|
Hi
OnResize would be related to the Datagrid control itself.
Rather try overriding OnPreferredRowHeightChanged in the DataGridTableStyle class. Like:
<br />
myGrid.Font = new System.Drawing.Font<br />
("Microsoft Sans Serif",<br />
15, System.Drawing.FontStyle.Regular);<br />
myGrid.PreferredRowHeight = myGrid.Font.Height;<br />
|
|
|
|
|
Wow, happens on my DataGrids too! Must be a bug in the MS code... no? In any case, exceptions should not reach the user like that!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
I have a problem getting my column headers correctly aligned in my datagrid. I've got a total of six columns and in most of them the column header text is right next to the column border with no margin/padding at all. In a couple of the columns the alignment seems to work though, but I haven't been able to any difference that should matter.
Here's a small portion of the code, taken from the InitializeComponent method:
this.dataGridTextBoxColumn5.Alignment = System.Windows.Forms.HorizontalAlignment.Right;
this.dataGridWaterColumn.Format = "p1";
this.dataGridWaterColumn.FormatInfo = null;
this.dataGridWaterColumn.HeaderText = "Percent";
this.dataGridWaterColumn.MappingName = "Percent";
this.dataGridWaterColumn.Width = 80;
The data is correctly aligned, it's just the header text that is misaligned. How come? The problem is the same whether I choose left, right or center alignment.
|
|
|
|
|
Can someone help me with a flicker free listview. I have tried setting the control styles but that doesnt seem to work. And when i set the control style UserPaint to true only the columns of the listview are painted. I guess this is because we are then responsible for all the painting. However, I dont want to go through all of that. Does someone know of another way to do this.
|
|
|
|
|
I had a similar problem a while back. Make sure that:
1. the control dont get invalidated after adding each item
2. you are not adding new items using AddRange()
within a loop.
Hope this helps
|
|
|
|
|
So should i be using the style controls?
|
|
|
|
|
I can't afford a copy of Visual Studio .NET for home use, so I'm trying to learn C# and .NET the cheap (hard) way i.e. the .NET SDK, a text editor and the command prompt. What I'd like to write are some Windows Forms applications, but I can't stand the thought of having to write the form layout by hand. Does anyone know of a free form designer that I can download and use with C#?
Gavin
|
|
|
|
|
Now if someone would just write a flash to usercontrol converter that would be nice or even better, the other way around, so we can get rid of those lame default web controls
|
|
|
|
|
The Visual Studio .NET Academic version is not so much expensive (did I spell it right?).
About $120.
I've bought that!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Hello!
Is it possible to reuse context menu items in the main menu(maybe from the designer,too) ? Or do I have to declare two menu items for duplicate commands and enable/disable them seperately for the same reasons (because something like CloneMenu would only clone the current property values me thinks)?
Cheers
and TIA
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Hi there! I've got 3 questions about programming C# controls:
1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory?
2. I would like the control to know, if it's in a Design mode or in a running app. User has to add all data to my control dynamicly and I want control to display some example while being in Design mode (sth. like TreeView in Win32 API in Resource Editor). How can I implement thing like that?
3. How can I change the control's icon that is displayed in the Toolbox?
Please! Help me!
MP
Maciej Pirog
|
|
|
|
|
Maciej Pirog wrote:
1. How can I bind my own property to one of the categories that are displayed in the Properties window (like 'Behaviour' ora 'Apperance')? Can I make my own cathegory?
Use the 'CategoryAttribute' on one of your control's properties
Maciej Pirog wrote:
2. I would like the control to know, if it's in a Design mode
Take a look at the Control.DesignMode property
Maciej Pirog wrote:
How can I change the control's icon that is displayed in the Toolbox?
Embed a bitmap in your assembly named the same as your control's fully qualified typename (plus .bmp). So if your control's full name is MyNamespace.MyControl, 'embed as resources' a 16x16 bitmap in your project named 'MyNamespace.MyControl.bmp'. Recompile, and studio should use that bitmap on the toolbox.
Check out the code for PropertyTree for an example of embedding Toolbox bitmaps in a control assembly.
--
Russell Morris
"WOW! Chocolate - half price!" - Homer Simpson, while in the land of chocolate.
|
|
|
|
|
Thanks! Tht's what I needed!
MP
Maciej Pirog
|
|
|
|
|
I have a webForm,Iwant that when the user click a button the page will change and I want to send this new page parameter (int id , string or anything else),
how can I do it? I move to the next page by:
Response.Redirect(...)
thank you very much, sharon
|
|
|
|
|
Look at the following link from MSDN
Clickety
|
|
|
|