|
For the formats
dd/mm/yyyy
dd-mm-yyyy
dd.mm.yyyy
(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d
|
|
|
|
|
A regular expression can not validate that the input is a valid date, only that it looks like a date.
---
b { font-weight: normal; }
|
|
|
|
|
I love the people who say "I need it quickly" Does that equate to "Stop what you're doing, and answer my question!!!"?
How about changing the tone to "I'm in a bind, with the boss breathing down my back"
|
|
|
|
|
Perhaps you should reply to the original poster?
---
b { font-weight: normal; }
|
|
|
|
|
Dear Friends,
I want to make project planner. like Visio. Any idea can give me for that?. how can i design that control. please help me.
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
|
I've looked into TWAIN and WIA but they both require legacy code interop.
Which doesn't make for a nice clean, easy to read project... and seeing as this will be my first imaging project I'm after somthing easy and clean and free of dabbling with C++/C# interop.
Any advice?
Thanks
|
|
|
|
|
Atalasoft has a commercial TWAIN library you could use. There is nothing in .NET for TWAIN or WIA, you need third party libraries to do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hello frenz,
I tried using Process.Start().
My application needs to run in Windows Small Business Server 2003 & when I try to call the exe(which is also a .net application) from my application, it gives me an exception.
On googling came across the fact that Windows2003 does not support the Process Class with non-admin users.
check this link...
http://www.atalasoft.com/kb/article.aspx?id=10106&cNode=3D8W4P
I came across this problem once the implementation was over & tried to use the application with a non-admin user.
Please help me guys.. Can somebody work out some solution for this ?
Thanks in Advance
|
|
|
|
|
jamesjk wrote: I tried using Process.Start().
Your other option is to pinvoke ShellExecute itself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Graus.
In fact I was also thinking of the same solution.
But am struck on how to pass the handle to window.
could u pls help me with some code snippets
Once again thanks for the suggestion
|
|
|
|
|
I'm not sure how you mean ? www.pinvoke.net is bound to have examples of how to use shellExecute via pinvoke.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Actually, the problem is with the Process class under the .NET Framework 1.0 and 1.1 (Visual Studio .NET 2002 and 2003). The Process class depends on getting process information from the Performance Counters. But, Windows Server 2003 doesn't support giving performance counter information to non-Admin users, so it breaks the functionality of the Process class.
This problem was fixed in the .NET Framework 2.0 (Visual Studio .NET 2005) because the Process class was re-written to not depend on the performance counter information.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave..
That was quite informative...
I'm using framework 1.1 for my application..
I'm not at all familiar with framework 2.0..
So could you pls tell me Can my problem be solved just by compiling my application with frame work 2.0. Would there be any kind of migration issues?
Since I'm in a desparate situation would appreciate each and every support given by U.
Once again Thanks for the support
|
|
|
|
|
jamesjk wrote: pls tell me Can my problem be solved just by compiling my application with frame work 2.0.
Possibly.
jamesjk wrote: Would there be any kind of migration issues?
The only way to tell is to try it. There ARE breaking changes between .NET 1.x and 2.0.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Sir and Madam,
How to draw rounded rectangle?
Thank You.
|
|
|
|
|
I seem to recall writing an article on how to do it, did you try searching the site ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Try Following.
Good Luck.
float radius = 5; // Radius for round curve
float diameter = 2 * radius;
// Basic dimensions where Roundrect is to be drawn
Rectangle BaseRect = new Rectangle(x1, y1, x2, y2);
SizeF RoundSize = new SizeF(diameter, diameter);
RectangleF RoundArc = new RectangleF(BaseRect.Location, RoundSize);
// Graphics object
Graphics G = Graphics.FromHwnd(this.Handle);
// Create Graphics path
GraphicsPath Gp = new GraphicsPath();
Pen P = new Pen(Brushes.Black);
// Top left arc
RoundArc.X = BaseRect.Left;
RoundArc.Y = BaseRect.Top;
Gp.AddArc(RoundArc, 180, 90);
//Top right arc
RoundArc.X = (BaseRect.Right - diameter);
RoundArc.Y = BaseRect.Top;
Gp.AddArc(RoundArc, 270, 90);
// Bottom right arc
RoundArc.X = (BaseRect.Right - diameter);
RoundArc.Y = BaseRect.Bottom - diameter;
Gp.AddArc(RoundArc, 0, 90);
// Bottom left arc
RoundArc.X = BaseRect.Left;
RoundArc.Y = (BaseRect.Bottom - diameter);
Gp.AddArc(RoundArc, 90, 90);
// Close Graphics path
Gp.CloseFigure();
// Draw graphics path
G.DrawPath(P, Gp);
|
|
|
|
|
i want to display some custom properties in propertygrid
Like...(1)Job :Engineer,Doctor,Teacher
(2)Class :I,II,III
I am using typeconverters like ACTDropDown derived from StringConvertor.How will i use the same class for both the purpose i.e for displaying Job& Class dropdowns separately.
|
|
|
|
|
Hi,
If you have knowledge in active directory keep reading and answer please,
I need to know how to add a user to a group in active directory.
Give me code please
Best regards
|
|
|
|
|
|
Hi all
I had created one windows service with VS2005 (C#) and installed that one in my local system with InstallUtil.Exe. The installations are completed Successfully, but i am not getting that service in service window (Computer Management , Service Window)
Can any one tel me the reason
Thanx
nidheesh
|
|
|
|
|
Hi,
I'm in need of populating the selected datagrid row in the respective fields in the form for updating the values.I have 3 levels in datagrid interlinked with parent - child relationships.As of now,I level is populating fine.But II level can have n number of records.When I'm selecting the II level,I couldn't be able to populate(I'm not getting any exception,But the Form is retaining the I level values.)
I'm herewith giving the mwthods that I'm using!
Please,let me know How should I approach!
I'm stuck up here!
private void DisplayDataList(string vstrProductCode)
{
StringBuilder stbSQLStatement0 = new StringBuilder();
stbSQLStatement0.Append("SELECT B.[ProductCode] ");
stbSQLStatement0.Append(" ,B.[ProductDesc] ");
stbSQLStatement0.Append(" ,SUM(A.QtyIn) As [In] ");
stbSQLStatement0.Append(" ,SUM(A.QtyOut) As [Out] ");
stbSQLStatement0.Append(" ,SUM(A.QtyIn) - SUM(A.QtyOut) As [BalBillQty] ");
stbSQLStatement0.Append(" ,(SUM(A.QtyIn) - SUM(A.QtyOut)) * Avg(B.ConvFactor) As [BalReportQty] ");
stbSQLStatement0.Append("FROM [MARTblInventory] As A WITH (NOLOCK) ");
stbSQLStatement0.Append(" INNER JOIN [MARTblProduct] As B WITH (NOLOCK) ");
stbSQLStatement0.Append(" ON A.ProductCode = B.ProductCode ");
stbSQLStatement0.Append(" and A.MarketSegID = B.MarketSegmtID ");
stbSQLStatement0.Append(" and A.SourceID = B.SourceID ");
if (! vstrProductCode.Equals(""))
{
stbSQLStatement0.Append("WHERE B.[ProductCode] LIKE '" + vstrProductCode + "%' ");
}
stbSQLStatement0.Append("GROUP BY B.[ProductCode] ");
stbSQLStatement0.Append(" ,B.[ProductDesc] ");
DataSet dtsResult0 = new DataSet();
dtsResult0 = QueryData(stbSQLStatement0.ToString());
StringBuilder stbSQLStatement1 = new StringBuilder();
stbSQLStatement1.Append("SELECT A.InvRefID ");
stbSQLStatement1.Append(" ,A.EntryDate ");
stbSQLStatement1.Append(" ,B.[ProductCode] ");
stbSQLStatement1.Append(" ,B.[ProductDesc] ");
stbSQLStatement1.Append(" ,A.[ReferenceNo] ");
stbSQLStatement1.Append(" ,A.QtyIn As [In] ");
stbSQLStatement1.Append(" ,A.QtyOut As [Out] ");
stbSQLStatement1.Append(" FROM [MARTblInventory] As A WITH (NOLOCK) ");
stbSQLStatement1.Append(" INNER JOIN [MARTblProduct] As B WITH (NOLOCK) ");
stbSQLStatement1.Append(" ON A.ProductCode = B.ProductCode ");
stbSQLStatement1.Append(" and A.MarketSegID = B.MarketSegmtID ");
stbSQLStatement1.Append(" and A.SourceID = B.SourceID ");
if (! vstrProductCode.Equals(""))
{
stbSQLStatement1.Append("WHERE B.[ProductCode] LIKE '" + vstrProductCode + "%' ");
}
DataSet dtsResult1 = new DataSet();
dtsResult1 = QueryData(stbSQLStatement1.ToString());
StringBuilder stbSQLStatement2 = new StringBuilder();
stbSQLStatement2.Append("SELECT A.InvRefID ");
stbSQLStatement2.Append(" ,B.PackageNo ");
stbSQLStatement2.Append(" ,B.Length ");
stbSQLStatement2.Append(" ,B.Area ");
stbSQLStatement2.Append(" ,B.ReferenceNo ");
stbSQLStatement2.Append("FROM [MARTblInventory] As A WITH (NOLOCK) ");
stbSQLStatement2.Append(" INNER JOIN [MARTblInventoryPkgDetail] As B WITH (NOLOCK) ");
stbSQLStatement2.Append(" ON A.InvRefID = B.InvRefID ");
if (! vstrProductCode.Equals(""))
{
stbSQLStatement2.Append("WHERE A.[ProductCode] LIKE '" + vstrProductCode + "%' ");
}
DataSet dtsResult2 = new DataSet();
dtsResult2 = QueryData(stbSQLStatement2.ToString());
DataSet dtsCombine = new DataSet();
dtsCombine.Tables.Add(dtsResult0.Tables[0].Copy());
dtsCombine.Tables[0].TableName = "Product";
if (dtsResult1.Tables[0].Rows.Count > 0)
//foreach(DataRow dr in dtsResult1.Tables[0].Rows)
{
dtsCombine.Tables.Add(dtsResult1.Tables[0].Copy());
dtsCombine.Tables[1].TableName = "ProductDetail";
dtsCombine.Relations.Add("ProductDetail",
dtsCombine.Tables["Product"].Columns["ProductCode"],
dtsCombine.Tables["ProductDetail"].Columns["ProductCode"]);
if (dtsResult2.Tables[0].Rows.Count > 0)
{
dtsCombine.Tables.Add(dtsResult2.Tables[0].Copy());
dtsCombine.Tables[2].TableName = "PackageDetail";
dtsCombine.Relations.Add("PackageDetail",
dtsCombine.Tables["ProductDetail"].Columns["InvRefID"],
dtsCombine.Tables["PackageDetail"].Columns["InvRefID"]);
}
ugdDataList.Text = mstrGridName;
ugdDataList.DataSource = dtsCombine;
ugdDataList.DataBind();
if (ucbProductCode.Text != "")
SeekTheSelectedRowInGrid(ucbProductCode.Text);
}
SetControlForMaintenance(CWinMaintainCln.MaintenanceMode.enmBlank);
pnlDataHeader.Visible = false;
}
private void DisplayDataDetail(string vstrDataKeyName)
{
StringBuilder stbSQLStatement0 = new StringBuilder();
stbSQLStatement0.Append("SELECT A.InvRefID ");
stbSQLStatement0.Append(" ,B.[ProductCode] ");
stbSQLStatement0.Append(" ,B.[ProductDesc] ");
stbSQLStatement0.Append(" ,A.ReferenceNo ");
stbSQLStatement0.Append(" ,A.Remarks ");
stbSQLStatement0.Append(" ,A.TransTypeID ");
stbSQLStatement0.Append(" ,A.QtyIn ");
stbSQLStatement0.Append(" ,A.QtyOut ");
stbSQLStatement0.Append(" ,A.EntryDate ");
stbSQLStatement0.Append("FROM [MARTblInventory] As A WITH (NOLOCK) ");
stbSQLStatement0.Append(" INNER JOIN [MARTblProduct] As B WITH (NOLOCK) ");
stbSQLStatement0.Append(" ON A.ProductCode = B.ProductCode ");
stbSQLStatement0.Append(" and A.MarketSegID = B.MarketSegmtID " );
stbSQLStatement0.Append(" and A.SourceID = B.SourceID ");
stbSQLStatement0.Append("WHERE A.ProductCode = '" + vstrDataKeyName + "' ");
//stbSQLStatement0.Append("Where A.InvRefID = '" + vstrDataKeyName + "' ");
DataSet dtsResult = new DataSet();
dtsResult = QueryData(stbSQLStatement0.ToString());
UltraGridRow activeRow = this.ugdDataList.ActiveRow;
lblInvRefID.Text = dtsResult.Tables[0].Rows[0]["InvRefID"].ToString();
ucbProductCode.Text = dtsResult.Tables[0].Rows[0]["ProductCode"].ToString();
lblProductDescDisplay.Text = dtsResult.Tables[0].Rows[0]["ProductDesc"].ToString();
txtReferenceNo.Text = dtsResult.Tables[0].Rows[0]["ReferenceNo"].ToString();
ucbTransactionType.Value = dtsResult.Tables[0].Rows[0]["TransTypeID"].ToString();
txtRemarks.Text = dtsResult.Tables[0].Rows[0]["Remarks"].ToString();
uneQuantityInDisplay.Value = double.Parse(dtsResult.Tables[0].Rows[0]["QtyIn"].ToString());
DateTime dtmEntryDate = new DateTime();
dtmEntryDate = Convert.ToDateTime(dtsResult.Tables[0].Rows[0]["EntryDate"].ToString());
if (dtmEntryDate.Year == 1900)
{
dtpDate.Checked = false;
}
else
{
dtpDate.Checked = true;
dtpDate.Value = dtmEntryDate;
}
StringBuilder stbSQLStatement1 = new StringBuilder();
stbSQLStatement1.Append("SELECT A.InvRefID ");
stbSQLStatement1.Append(" ,B.PackageNo ");
stbSQLStatement1.Append(" ,B.Length ");
stbSQLStatement1.Append(" ,B.Area ");
stbSQLStatement1.Append(" ,B.ReferenceNo ");
stbSQLStatement1.Append("FROM [MARTblInventory] As A WITH (NOLOCK) ");
stbSQLStatement1.Append(" INNER JOIN [MARTblInventoryPkgDetail] As B WITH (NOLOCK) ");
stbSQLStatement1.Append(" ON A.InvRefID = B.InvRefID ");
stbSQLStatement1.Append("WHERE A.InvRefID = " + lblInvRefID.Text + " ");
DataSet dtsResult1 = new DataSet();
dtsResult1 = QueryData(stbSQLStatement1.ToString());
dtsResult1.Tables[0].TableName = "Add new Package Detail";
ugdPackageDetail.DataSource = dtsResult1.Tables[0];
ugdPackageDetail.DataBind();
if (mblnIsRowSelected)
SetControlForMaintenance(CWinMaintainCln.MaintenanceMode.enmReady);
}
Thank you,
Deepa
Be the Change You Want to See!
|
|
|
|
|
Can anyone help me. The solutions to the following questions are proving quite difficult to find from books and references.
1. How do I associate different data sources to each row of a datagrid control?
2. I would like the data grid to have both a customized vertical header (at the top) and a customized horizontal header (in the rightmost column)
3. Finally, how do I perform calculations to the dataset. For example, I would like to programmatically sort the rows according to the 3rd column. Or calculate the average of the 1st column and other adhoc calculations. I'd imagine there'd be built-in functionalities rather than copying the dataset to a linked-list/array/other custom container class and do the calculations from there.
Look forward to hearing from anyone. Thanks in advance.
cheers!
|
|
|
|
|
1) Not possible
2) Override ItemCreated or DataBind events and add the column to each row
or iterate through the datatable before it is bound to the control and add the column.
3) DataTable.Compute("Avg(col1)");
only two letters away from being an asset
|
|
|
|