|
Thanks, that solved my problem!
|
|
|
|
|
SqlServer likes to see a char dates in a specfic format. You will have to experiment a little but from memory it likes:
01/01/98
OR
01/01/98 23:59:59.999
It is not very tolerant with other formats.
Try date.ToString("dd/MM/yyyy HH:mm:ss.000") in place of date
BTW: I normally let the SQL Server set a DateTime stamp by using GetDate() in place of '" + date + "' . It will usually have a more accruate time then a workstation (at least it will be a common clock). There is also GetUTCDate() for when your users are in different time zones.
|
|
|
|
|
Michael Potter wrote: Try date.ToString("dd/MM/yyyy HH:mm:ss.000") in place of date
date.ToString("s"); works for me as well. This put a "T" between the date and the time, but that seems to be accepted by MySQL in my case.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have written a function called MyFunction() in a class library called TestClassLibrary. Now supppose that at design time a user creates an object of this class and presses dot(.) with the object to view the related functions, properties etc in the auto context menu. I want that whenever the user selects MyFunction() in that auto context menu, a little description of MyFunction() is displayed as tooltip as it appears with the built in functions. How to do that?
Thanks in advance
|
|
|
|
|
You need to apply a 'Description' attribute to the function. Here is an example:
[Description("Override this method if anything needs to be saved other than the ActivePanel.")]
public virtual bool CanClose()
{
if (this.ActivePanel != null)
return ActivePanel.CanClose();
else
return true;
}
|
|
|
|
|
You don't need to use the Description attribute, as mentioned in the other reply. That attribute will provide the text shown in the property grid for a property. What you are looking for is XML comments. Use the triple-slash comments on your method. Then:
1)Open the Property Pages for your class library project in Visual Studio.
2) Click 'Configuration Properties' and then 'Build' in the TreeView on the left.
3) You'll see under the 'Outputs' section a property called 'XML Documentation File'. Set that value to <AssemblyName>.xml (where AssemblyName is the name of the assembly). For example, if your assembly is foo.dll then call your XML file foo.xml
That will cause your XML comments to be included in an output file generated every time you build. Consumers of your DLL should put that XML file in the same directory which contains the DLL, so that while using your types they'll get IntelliSense w/ your comments.
Josh
|
|
|
|
|
That's good to know. Curious though ... using the Description attribute has worked for me in the past ...
|
|
|
|
|
I learned something new, too. I never knew that the Description attribute was used by Visual Studio's code editor. I wonder if there is a way to express parameter-level information using attributes, instead of triple-slash comments. That would be handy for creating thoroughly self-describing components.
Thanks for the info
Josh
|
|
|
|
|
I have a loop in which I'm populating a form. I try to click a button called "Abort" to terminate the loop but I can't until the loop ends by itself. How can I fix this?
|
|
|
|
|
|
Background:
I'm taking a query from an Oracle Database into a DataSet. Then taking a query from an SQL Database into another Dataset. Merging the 2 datasets, and running the DataAdapter Update. The goal is to keep the Oracle and SQL database tables in sync, and to know what (if any) rows get added/deleted/modified. The issue I'm having is, the Update will update ALL the rows with the same information, or none of the rows even if there are changes. Some additional info, the Oracle Table and the SQL Table don't exactly match, but the Keyed fields are the same (the SQL table has some custom added flags and such). When I do the select, I ONLY select the like fields, in the correct order, and cast the Oracle column Names to be like the SQL column names.
<br />
SqlDataAdapter regionDa = new SqlDataAdapter(regionSql, _sConn);<br />
DataSet regionDs = new DataSet();<br />
<br />
regionDa.UpdateCommand = updCmd;<br />
regionDa.InsertCommand = insCmd;<br />
<br />
OracleDataAdapter oDa = new OracleDataAdapter(oSql, _oConn);<br />
DataSet oDs1 = new DataSet();<br />
<br />
regionDa.Fill(regionDs);<br />
oDa.Fill(oDs1);<br />
<br />
regionDa.FillSchema(oDs1, SchemaType.Source);<br />
regionDa.FillSchema(regionDs, SchemaType.Source);<br />
<br />
regionDs.Merge(oDs1);<br />
<br />
regionDa.Update(regionDs, regionDs.Tables[0].TableName);<br />
Any help would be greatly appreciated.
Thanks!
Scott
|
|
|
|
|
Good day everyone,
I need to do a Login system in ASP.Net using C#.Net as code behind page for my website.
I've got an Access database conntaining username and password.
Is there anyone know where can I find a sample project?
If you're interested in, pls help
Thanks so much.
eric
|
|
|
|
|
Please dont crosspost - this belongs in ASP.NET where you have already posted it!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
The code snippet:
namespace PrintForm
{
public partial class Form1 : Form
{
public Form1(string urlToPrint)
{
InitializeComponent();
webBrowser1.Url = new Uri(urlToPrint);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Print();
webBrowser1.Dispose();
Application.Exit();
}
}
}
I get an error :
RaceOnRCWCleanup was detected
Message: An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.
The error occurs on the webBrowser1.Dispose call.
Using VisStudio 2005
If I put up a message box right after the webBrowser1.Print() call, my document does get printed. I dont see any event handling of printing so theres nothing I can pend on (IsBusy returns false, its apparently only valid for navigation, not useable during printing)
Ideas?
Thanks!
|
|
|
|
|
hi,
i need to design survey software using c#.net. this software will desing survey. all the information of survey will be store in xml file (questions, answeres, type of question...). i would like to know if there is any code on net that i could take look or anyone can help me where to start.
Thanks,
|
|
|
|
|
ap_sa wrote: i need to design survey software using c#.net. this software will desing survey
Looks like an infinite loop to me.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
If MFC code is as follows:
//*CODE SNIPPET - START*
long newtime = 1136710800;
CTime tm(newtime);
str = tm.FormatGmt("%d %m %Y\n%H:%M:%S");
//*CODE SNIPPET - END*
At the execution of last line, 'str' contains as "1/8/2006 9:00:00 AM".
//Question
HOW CAN I REPRODUCE THIS CODE IN C#?
I'll be very thankful if replied at the earliest.
-Kiran
|
|
|
|
|
System.DateTime contains the same capacity as CTime to be constructed from a value and then use the ToString() method to format into a string.
However the underlying values are different. CTime uses seconds since January 1, 1970 while DateTime uses a unit (tick) smaller than a second and starting at January 1,1. So you can't use a CTime value to initialize a DateTime value unless you convert it first.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
hi everybody, i'm new in this, i wanna know if somebody knows how can i block the hot keys of excel, word or another program like this , i open these kind of files from c#, is it possible? . Ahm i'm sorry for my bad english jejeje. Thank's everybody!!!
|
|
|
|
|
I am using a statusstrip control in C#, and I am trying to place a ToolStripLable. I want this label to appear at the right end of statusstrip, Can anyone please tell me how to do this?
thanks,
arti
|
|
|
|
|
Put 2 labels on the statusstrip and set the "Spring" property of the left one to "true". That will push the one on the right out to the end of the strip.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
You can also do this with a single label. Set 'Spring = true' and 'TextAlign = MiddleRight'.
|
|
|
|
|
I was wondering if it is possible to have an icon or imagem (animated gif) on the right of the MainMenu, under the control box. Like IE has, or FireFox, or Explorer. I have searched everywhere on a way to do this without any luck.
|
|
|
|
|
MainMenu does not support having an image displayed on it. Since MainMenu is not a control, there is no way to custom render the image in an OnPaint override either (there is no OnPaint to override). The only option that I can think of is to PInvoke into whatever API is used by IE/Explorer to get that image on the menu. I have no clue what Win32 function provides that functionality.
Josh
|
|
|
|
|
Hi im new to SNMP and developing SNMP applications. I want to code up a custom agent that will run on a projector that is on my network. I was hoping
I could get some guidance as to how to go about this e.g.
How do I deploy it onto the projector?
whether it is possible to use the C# API, if so what class libraries?
if it would be better using something off the shelf to develop it?
Do I need to know about the low level API of the projector?
Any help on this would be much appreciated.
Mike
|
|
|
|