|
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
|
|
|
|
|
j11Software wrote: I would like to programmatically sort the rows according to the 3rd column
You can do this by clicking the column header of your datagrid. Then you have to synchronize your dataset with the datagrid (this was the case 1.0, 1.1) I know there's a way by using key-pairs or something like that, but you could also cast the datagrid-view to a DataTable and work from there.
For average you'll have to do that manually I think. A count is dataset.Tables[0].Rows.Count;
Hope this helps
Good luck
|
|
|
|
|
Hi,
I have an instance of data table named Customers with the
columns "Name, Address, City, State, ZipCode",
sitting inside a dataset MyDataSet.
I have a BindingSource associated to the MyDataSet/Customers.
Without creating another instance of the table, I want to bind
it to a data grid view, and only have Name and Address columns
show up in the DataGridView.
One way I know I can do it is to do a Visible=false on DataBindingComplete event for columns
that I don't want displayed.
But I am trying to avoid all that unnecessary adding of columns
and hiding them when my requirement is to not deal with those columns
at all.
Just wondering if there is a way to bind a DataGridView to an
already available instance of a DataTable and limit the databinding
to only specific columns?
I appreciate you all sharing any insights regarding this.
-Athadu
|
|
|
|
|
Hello,
Is it possible to write action script in C#. Actually I want to stream video using Flash Communication Server. Now I want to stream video to another c# application on a different computer or to the web. Sorry if I wasn't clear. Please if someone could help me, it would be greatly appreciated. Thanks.
|
|
|
|
|
|
I have a variable number of DropDownList controls inside a Datalist control. This variability depends of the number of records in a DataTable.
I would be grateful if someone could tell me how to create ListItem controls accordingly with the data contained in a DataTable.
Here are the 4 possible ListItem controls to be inserted:
<asp:ListItem Value="blue" >Blue</asp:ListItem>
<asp:ListItem Value="red" >Red</asp:ListItem>
<asp:ListItem Value="black" >Black</asp:ListItem>
<asp:ListItem Value="white" >white</asp:ListItem>
For instance, if a product is manufactured with one of two colors ( let’s say “red” and “white” ) then the DataTable contains these binary values: “false”, “true”,”false”,”true” or ( 0,1,0,1) in the parameters “showBlue”, “showRed”, “showBlack”, “showWhite” for the four ListItem controls. So, in this example, I would want to use these data to create only ListItem controls for the red and the white options.
How do that ?
Here are the relevant pieces of code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<asp:DataList ID="ProductsList" Runat="server" EnableViewState="False" Visible="false" >
<ItemTemplate>
. . .
<span class="Title">
Product: <%# Eval("Title") %>
</span>
</td>
</tr>
<tr>
<td align="center" width="250">
<span class="Colors">
<asp:DropDownList ID="ColorsList" OnSelectedIndexChanged="GetColor" runat="server">
</asp:DropDownList>
</span>
</td>
</tr>
. . .
</ItemTemplate>
</asp:DataList>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
protected void InsertDataInDataList()
{
ProductsList.DataSource = UserAccess.UserProducts(Username);
ProductsList.DataBind();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Obs: The “UserAccess.UserProducts(Username)” method returns a DataTable with variable number of records.
|
|
|
|
|
hi
i was installed sqlServer 2005 management Studio Express on my Server and i want to connect from my app (in other computers) to this database,but when i want add datasource to my project and select Microsoft SqlServer and inter Server's Name + "\SQLEXPRESS", i can not connect to database's, and i don't know where does the problem.
can anybody show me how to solve this problem ?
thanks
|
|
|
|