|
One of the key features of log4net is that you are able to configure it to use any log appender - even one you have written yourself. It should be fairly simple to write your own appender that uses discards these entries, and use this just by adding the appropriate configuration entries. I demonstrate a custom appender in this[^] blog entry.
|
|
|
|
|
hi all,
i saw www.igoogle.com site and see how can move, minimize, expand ,move and increase gedget length, i want to create a gadget like that in igoogle in my windows form application.
please help me how i can create gadget like it in my windows form application.
thanks all.
|
|
|
|
|
zead wrote: i want to create a gadget like that in igoogle in my windows form application
What do you mean by "like that"? Do you want something that's visually similar, or do you also want to enable the user to create their own 'gadgets'?
You could start with a plain form; you can move, minimize, expand and move those. Dock 'em on a panel, and you'd have something that resembled the iGoogle mainpage. Docking a form on a panel is done by adding it to the controls-collection of the panel.
I are Troll
|
|
|
|
|
hey guys..i have a SqlTable which consists of 3 columns and 1 row..i have 3 labels on my form and try to change these labels' texts with the datas in my database
i tried something like that
cmd = new SqlCommand("sp_Deneme", conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
cmd.ExecuteReader();
dt = new DataTable();
DataRow row = dt.NewRow();
for (int i = 0; i < reader.FieldCount; i++)
{
dt.Columns.Add(i.ToString(), Type.GetType("System.String"));
dt.Rows[0][i] = reader[i].ToString();
}
label1.Text = dt.Rows[0][1].ToString();
label2.Text = dt.Rows[0][2].ToString();
label3.Text = dt.Rows[0][3].ToString();
but there is no change..my way is wrong ?
vemedya.com
|
|
|
|
|
You are not getting the data. All you have done is set things up ready to get the data.
You need to get the reader to do a Read() and in order to do that you will need to have a SqlDataReader member to use in the call.
change:
cmd.ExecuteReader();
to
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You didn't tell the system which procedure to execute.
Why use a DataTable? Just copy the values from the DataReader to the labels.
On the other hand, you shouldn't have the data access in the UI layer, but that's another matter.
modified on Saturday, December 11, 2010 12:52 PM
|
|
|
|
|
create Proc [dbo].[sp_Deneme]
as
Begin
select * from Rehber
End
hey friend..i use that procedure to get datas and i tried like that and it worked..
cmd = new SqlCommand("sp_Deneme", conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
label1.Text = reader.GetInt32(0).ToString();
label2.Text = reader.GetString(1);
label3.Text = reader.GetString(2);
}
vemedya.com
|
|
|
|
|
|
No comment on SELECT * ?
And what about numbered fields as in GetString(1) ?
|
|
|
|
|
Luc Pattyn wrote: No comment on SELECT * ?
I use that all the time.
Luc Pattyn wrote: GetString(1) ?
Eh, yeah, I never use the Get methods, I generally just cast to the type, but whatever; it's better than it was.
|
|
|
|
|
if the fields get reordered, the code breaks.
which wouldn't happen when the fields were named explicitly: SELECT fieldName1,fieldName2,fieldName3 ...
The alternative is more cumbersome: reader.GetString(reader.GetOrdinal("fieldName2"))
|
|
|
|
|
Luc Pattyn wrote: if the fields get reordered
Who'd do a silly thing like that?
IDataReader fields can be accessed by name too.
Item [([(String ])]) Gets the column with the specified name. (Inherited from IDataRecord.)
This is from the WCF experiment I was playing with last spring:
dr = this.con.ExecuteReader
(
@"
SELECT *
FROM JunkName
WHERE Id=@Param0
"
,
ID
) ;
if ( dr.Read() )
{
result = new Junk.Types.Record()
{
ID = (System.Guid) dr [ "ID" ]
,
LastName = (string) dr [ "LastName" ]
,
FirstName = (string) dr [ "FirstName" ]
,
Gender = (Junk.Types.Gender) (byte) dr [ "Gender" ]
,
FavouriteColour = Colour.Parse ( (string) dr [ "Colour" ] )
,
Created = (System.DateTimeOffset) dr [ "Created" ]
} ;
}
|
|
|
|
|
PIEBALDconsult wrote: reordered. Who'd do a silly thing like that?
Could happen by accident, after a refactoring; or maybe a convoluted backup/restore operation.
PIEBALDconsult wrote: IDataReader fields can be accessed by name too.
Sure, that is what you and I would do. All but referring by ordinal. So I did expect your objection to it.
|
|
|
|
|
Luc Pattyn wrote: I did expect
I try to do the unexpected and not the expected -- much like the Spanish Inquisition... oh, but maybe you expected that.
|
|
|
|
|
PIEBALDconsult wrote: maybe you expected
you'll never now.
|
|
|
|
|
Hi
I am working on Windows 7 x64, VS2008, FW 3.5, C# only.
I have developed a pretty complex GUI User Control, involving many UserControls planting inside table layout with in table layout with in tab layout control etc.
When starting my form, holding my complex User Control, in maximize mode all looks fine.
When starting to shrink it and then resize it (dragging the mouse from bottom right corner...) the 'deep' user controls and their components starts to be twisted and do not repaint properly.
Some of them are left half painted, showing leftovers of earlier refreshment actions happen on their pixels...
I have tried to test it and initiate (using a button) a refresh, invalidate and perform layout actions on my top UserControl, as well as on my deep one(s), but nothing helps.
I have these 'deep' user control(s) planted in other places in my GUI (less complex one I admit) and they all work properly on resize over there.
My questions:
1. Does any one have any explanation why this is going on?
2. Is there a guide line when designing a GUI in C# (or in .NET at all..) that says not to exaggerate in nesting up controls within layouts? Is there a particular overhead for this increased nesting?
3. Are there any other refresh/repaint methods that I might initiate that can fix the situation?
Thanks a'head
The Shultz.
|
|
|
|
|
Hi,
I don't have any references for this, however my advice would be:
1. keep GUI's simple; don't use dozens of Controls on a single Form, as it will have a negative impact on performance (not on correct painting though), and is likely to confuse the user; either use fewer but more appropriate Controls, or consider using more than one Form.
2. from what you described: make sure custom Paint handlers also call their base.OnPaint() .
|
|
|
|
|
Hi
1. I tend to agree, but:
A. some time GUI needs to present the user multiple options and things to define.
If the user must set these things, the GUI tends to be more 'complex' then 'simple' and you cannot run from it.
Off course there are techniques how to reduce the overhead for user (use tab control, table layout etc...) but you cannot always avoid it.
This is my case and I can't actually make it 'simpler' in the aspect of less controls and components with in
B. I personally don't like, as a user, to deal with GUI that pops up forms in which things have to be defined. I tend to like much more a fixed GUI that all screens are with in, and navigation between them is done using tab control, split container etc. that is my design here as well.
2. I am not using any custom paint, so there is no reason for the controls not to redraw them selves by the system.
Note that my User Controls are used else where in my system and they function well, so I can't believe it's a structural problem with a refresh method call that is not being called when it should...
Thanks any way
The Shultz.
|
|
|
|
|
I'm not really a Winforms bod, but do *vaguely* remember that the first thing that MS suggests with rendering problems is to ensure your Graphics drivers are up to date (naturally the problem can't be Microsoft's Rendering Mechanism ). I'd just check this before going on a wild goose chase.
Oh, I really do mean vaguely remember by the way.
|
|
|
|
|
Hi
Since my 'failed-to-repaint' User Controls are palced in other locations in my GUI, and works properly there, I can't seem to believe that this is indeed a wrong/old/bad/corrupted graphics issue, but still worth the checking...
so:
- How can I verify the 'up-to-date' of my graphics drivers ?
- Why/How could it be that they will become not 'up-to-date' ?
|
|
|
|
|
What parts of your controls are not getting repainted? Text? Parts that are in certain containers? Does selecting the control or selecting another force a repaint?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
For example:
- I have a list view with 10 columns and horizontal and vertical scroll bar.
When the user control gets resized, not all the columns header can be seen properly and some of their text gets mixed.
The scroll bars disappear (while they shouldn't).
When I reload items to the list it gets repainted well from the beginning.
- I have some labels with in cells in table layout. When it shrinks the label automatically wraps its text with in and changes its size over the screen, when its gets spread again, some of the labels is text remain shady and gets mixed up with neighborhood labels.
It seems like the repaint operation simply does not come to its end, so the screen is left with former pixels status - pixels that should have been repainted had the operation would have completed. How can it be?
just selecting the control and gain him a focus does not couze it to be repainted. (it should have done so ?)
I m kind'a new here, is there a way that I can upload some small printscreens to farther demonstrate what I am experiance ?
|
|
|
|
|
Hi.
How can i save a word document to xml format for parsing later with xslt.
I noticed that word 2007-2010 document are constructed with the openxml format so i can use openxml tools to save it.
But word 2000-2003 seems to be in binary format.
Is there a tool that i can use for this mission?
Thanks
|
|
|
|
|
Haim Nachum wrote: Is there a tool that i can use for this mission?
Yes, Word and Save As
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Do you (a) need to access the spreadsheet data programatically, or (b) do you just need a conversion tool.
If (a), there are one or more articles on this site that will discuss the pre-XML Word format and how to read and manipulate the data.
If (b), what level of automation do you require? Indeed, File | Save as in a recent version will let you save in either OOXML or ODF formats.
|
|
|
|