|
In my code I have the column name in brackets. It's only in the error message that it doesn't have the brackets, I thought that to be a bit strange. Also, I also few other columns that have a hyphen in them, I am only getting the error on that specific one.
-- modified at 17:12 Tuesday 1st May, 2007
|
|
|
|
|
No, this is not strange since brackets usually are not reported on error messages. I'm still doubting about the hyphen...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
bcp.ColumnMappings.Add(new SqlBulkCopyColumnMapping("RS-I2", "[RS-I2]"));
It's in brackets right there, I'm at a loss. I am about to light myself on fire and start punching myself in the face
|
|
|
|
|
Hi,
I tried to formart a double to a 10 digits, and 5 fixed points string.
say if I have a double variable with a value as "512.297812223" and want it to be displayed as " 512.29781"
I surveyed the internet , but seems not finding a solution for this issue.
You help is much appreciated.
Meng
|
|
|
|
|
.ToString("####0.00000")
---
single minded; short sighted; long gone;
|
|
|
|
|
And
System.Console.Write ( "{0:####0.0000}" , 123.456789 ) ;
|
|
|
|
|
how can I use date/time in c# to get only the time.....?
lavi
|
|
|
|
|
lavy2883 wrote:
how can I use date/time in c# to get only the time.....?
DateTime.Now.TimeOfDay(); -> returns Timespan
DateTime.Now.ToLongTimeString(); -> returns hh:mm:ss
DateTime.Now.ToShortTimeString(); -> returns hh:mm
|
|
|
|
|
The string that we want to read can contain only the time without the date .....?
|
|
|
|
|
So what you really want to do is to parse a string that represents a time of day?
You can use the ParseExact method to parse any kind of date/time value. As the result is a DateTime value, it will always has a date component, though.
---
single minded; short sighted; long gone;
|
|
|
|
|
DateTime.Now.ToLongTimeString(); -> returns hh:mm:ss
DateTime.Now.ToShortTimeString(); -> returns hh:mm
These functions gives you the time alone as a string and not the date.
Have a look at this link on MSDN.[^]
|
|
|
|
|
A DateTime value always has a date component. You can create a TimeSpan value that represents the time span from midnight.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
As Tarakeshwar showed, the TimeOfDay method does that.
---
single minded; short sighted; long gone;
|
|
|
|
|
the problem is... if the input which is a string need to have the date too or not....?
|
|
|
|
|
No, it doesn't. When parsing the string you can for example specify a format like "HH:mm:ss" which would be able to parse a string like "21:13:48". As the parsed data only contains the time component, the date component will be given a default value. I don't remember if the current date is used, or the date 0001-01-01.
---
single minded; short sighted; long gone;
|
|
|
|
|
Have you tried:
string now = DateTime.Now.ToString("HH:mm:ss");
I believe this should do exactly as you are wanting. If not, you can look up DateTime in your local help files to see if they have any other ways of doing this.
Phil
|
|
|
|
|
public void tab_Paint(object sender, PaintEventArgs e)<br />
{<br />
TabPage tab = (TabPage)sender;<br />
BufferedGraphicsContext context;<br />
BufferedGraphics buffer;<br />
context = new BufferedGraphicsContext();<br />
Graphics grfx = e.Graphics;<br />
buffer = context.Allocate(grfx, tab.ClientRectangle);<br />
drawSurfaceToBuffer(buffer.Graphics);<br />
buffer.Render(grfx);<br />
buffer.Dispose();<br />
grfx.Dispose();<br />
}<br />
public void drawSurfaceToBuffer(Graphics bufferGrfx)<br />
{<br />
}
this code i understand it from MSDN and write it to reduce Graphics Flicker but it does not make any thing at all also it make my background of tabpage black and the original is white
is there any suggestions please
Generator
-- modified at 10:59 Tuesday 1st May, 2007
|
|
|
|
|
I think this code is meant to reduce flicker for user-painted graphics. If you're just putting controls onto the tabpage and seeing flickering whenever you move/resize, this code won't help you at all, and might actually slow you down.
You might just have too many controls, which leads to too much layout logic. I would suggest trying to limit the number of controls and nested containers. For instance, putting panels inside panels inside panels, each with their own anchors, docks, and layout engines, will really slow you down whenever you resize.
|
|
|
|
|
In the 2.0 Framework there was a lot of work incorporating Double Buffering into the framework. For the form that holds the flickering control, try adding this at initialization time:
this.SetStyle( ControlStyles.OptimizedDoubleBuffer );
this.SetStyle( ControlStyles.AllPaintingInWmPaint );
These two settings go hand-in-hand. Also when loading controls on the tab,
this.TabControl.SuspendLayout();
LoadControl(TabControl);
this.TabControl.ResumeLayout();
|
|
|
|
|
hi ,
i can not find a method called LoadControl()
thanx
Generator
|
|
|
|
|
That was just shorthand in the example. That is where you are loading the controls into the new tab. Basically you suspend layout, load the controls, resumelayout and then the TabControl displays the controls all at once. Did you ever look at the Window Generated code for a form??? Look at it. This is what is standard code when a design-time-generated form is populated. Look at the code as an example and follow it.
|
|
|
|
|
hi ,
ok i looked at the generated code but i use setstyle before and no change on tab just change on form
so what can i do explain please
"Iam sorry but i didnot get the point"
Generator
-- modified at 3:35 Saturday 5th May, 2007
Generator
|
|
|
|
|
hi all,
first thanx for ur help
second a friend to me solve our problem of double buffered
as follows
class customTabPage : TabPage
{
customTabPage():base()
{
this.DoubleBuffered = true;
}
}
Generator
|
|
|
|
|
I need to get the serial number of a thumb drive that contains a specific file. Then, I need to make sure the serial number in the file is the same as the device's. Then, I need to check periodically that the device is still there, and that the serials still match.
Anyone want to help me figure this out? Boss wants me to get this done yesterday.
|
|
|
|