|
Thanks leppie,
.Net is installed. Do you mean the %PATH% when you say "in your PATH"? If yes, could you post your %PATH% please? I want to check whether mine is correct by comparing with a correct one.
(BTW: if not using Windbg, my C# application can run without any issues, so I do not think it is PATH issue, anyway, it is good to check the PATH with you to learn something more.)
regards,
George
|
|
|
|
|
Hi, i got a datagridview and the column ID 6 is a column which shows the price and columnID 0 have a checkbox.
How do i calculate the price when the check box is ticked or unticked.
I tried at a timer with interval of 1 second to check
private void timeCountPrice_Tick(object sender, EventArgs e)
{
double price = 0.0;
foreach (DataGridViewRow dgw in dataGridProduct.Rows)
{
DataGridViewCheckBoxCell datacell = dgw.Cells[0] as DataGridViewCheckBoxCell;
try
{
if ((bool)datacell.Value == true)
{
price += Convert.ToDouble(dgw.Cells[6].Value.ToString());
lblTotalPrice.Text = "Total Price : $ " + price;
}
}
catch (Exception exc)
{
}
}
}
But it dont seems to work
|
|
|
|
|
benjamin yap wrote: But it dont seems to work
What does not work?
|
|
|
|
|
When i tick the checkbox in first column of datagrid, the lblTotalPrice does not update.
And also i want it when its being untick, it will minus the value from totalprice
|
|
|
|
|
You could subscribe to the DataGridView's CellClick event, so that you know when a cell's actually been clicked. Inside the handler you get told the row and column so you can work out if it's a checkbox cell, then update your totals accordingly.
|
|
|
|
|
Okay, 1 more question
I have a form called ModifyOrder. Basically my form have 2 hashtable. I called orderTable and the other is productTable.
My orderTable stores an Order object. Below is my class for Order.cs
namespace EBMS
{
public class Order
{
private string refNumber;
private string custName;
private string destAdd;
private string destCity;
private string orderDate;
private double totalPrice;
private Hashtable itemList;
I got a attribute which store a list of items( from the productTable) into a hashtable called itemList inside my Order class
I have a datagridview which shows all the record i have in my productTable and the first columm of the datagrid is a checkbox.
When the user enter the Order's Ref Number to be modify, the datagrid wil show all the productTable. I want the first column(checkbox) to be checked if the product exists inside the Order class itemList.
How do i go about it?
I tried this code, but it does not tick the checkbox
if (orderTable.ContainsKey(tbxSearchRefNum.Text))
{
tbxRefNumber.Text = ((Order)orderTable[tbxSearchRefNum.Text]).RefNumber;
tbxCustName.Text = ((Order)orderTable[tbxSearchRefNum.Text]).CustName;
tbxCity.Text = ((Order)orderTable[tbxSearchRefNum.Text]).DestCity;
tbxAddress.Text = ((Order)orderTable[tbxSearchRefNum.Text]).DestAdd;
this.dataGridProduct.Rows.Clear();
int currentRow = 0;
foreach (Product p in productTable.Values)
{
this.dataGridProduct.Rows.Add();
this.dataGridProduct.Rows[currentRow].Cells["colProductName"].Value = p.Name;
this.dataGridProduct.Rows[currentRow].Cells["colModelNumber"].Value = p.ModelNumber;
this.dataGridProduct.Rows[currentRow].Cells["colCategory"].Value = p.Category;
this.dataGridProduct.Rows[currentRow].Cells["colDesc"].Value = p.Description;
this.dataGridProduct.Rows[currentRow].Cells["colMSRP"].Value = p.MSRP;
this.dataGridProduct.Rows[currentRow].Cells["colRetailPrice"].Value = p.RetailPrice;
foreach (DataGridViewRow dgw in dataGridProduct.Rows)
{
DataGridViewCheckBoxCell datacell = dgw.Cells[0] as DataGridViewCheckBoxCell;
try
{
Order newOrder = new Order();
newOrder = (Order)orderTable[tbxRefNumber.Text];
uint modelNumber = Convert.ToUInt32(newOrder.ItemList[p.ModelNumber]);
if (dgw.Cells[2].Value.ToString() == Convert.ToString(modelNumber))
{
this.dataGridProduct.Rows[currentRow].Cells["colSelect"].Value = true;
}
}
catch (Exception exc)
{
}
}
currentRow++;
}
}
|
|
|
|
|
hi,
how to de select grid combo when value is selected in combo.
thanks
Syed Shahid Hussain
|
|
|
|
|
HI,
Am trying to retreive some data into the Visual Studio C#.net (Winforms) combobox from a access database, but when i run it, i get only the first record, Please help me out.
Thanks
Vibin
private void Form2_Load(object sender, System.EventArgs e)
{
int count=0, b=0;
try
{
con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\JET PRINT LIMITED\\JET PRINT LIMITED.mdb");
da=new OleDbDataAdapter("select * from STOCKDET",con);
con.Open();
ds=new DataSet();
da.Fill(ds,"STOCKDET");
comm.Connection=con;
comm.CommandType=CommandType.Text;
da=new OleDbDataAdapter(comm);
dr=ds.Tables [0].Rows [b];
comboBox1.Items.Add (dr[1].ToString());
MessageBox.Show("data into Combobox successfuly!!!");
MessageBox.Show("Connected successfuly!!!");
}
catch(Exception k)
{
MessageBox.Show(k.Message);
}
}
|
|
|
|
|
You are always returning the first row...
int count=0, b=0;
dr=ds.Tables[0].Rows[b];
comboBox1.Items.Add (dr[1].ToString());
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Thanks for the reply
Please guide me on what i should include to get all the data in that particular column.
|
|
|
|
|
Hi.
You should databind:
Combobox1.DataSource = ds.Tables[0];
Combobox1.DisplayMember = "Column name for column to display";
Combobox1.ValueMember = "Column name for ID column";
Kjetil
|
|
|
|
|
firstly you are using a reader with a dataset and that confuses more.
if you want to retrieve what is in the command object and in future you won't manipulate the data, you should use only a datareader.so you have combined dataset and a datareader. your code above can be written like this
OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\\JET PRINT LIMITED\\JET PRINT LIMITED.mdb");
OleDbDataReader dr;
OleDbCommand comm = new SqlCommand();
comm.Connection=con;
comm.CommandType=CommandType.Text;
comm.CommandText = "select * from STOCKDET";
con.Open();
dr=comm.ExecuteReader();
con.Close();
comboBox1.Datasource=dr;
MessageBox.Show("data into Combobox successfuly!!!");
MessageBox.Show("Connected successfuly!!!");
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I'm trying to make a program what can let me know when a USB device is removed from a system. If anyone has any ideas or help that would be
great!
Thanks in advnace,
|
|
|
|
|
hello
I m getting an error "Virtual memory is to low"; while running my real-time application that is developed in C#.In our application, we are capturing the Live video and transmitting on LAN as well. IS IT ANY hARDWARE PROBLEM
B!z
|
|
|
|
|
B!Z wrote: IS IT ANY hARDWARE PROBLEM
No, your application is probably causing a memory leak. Monitor it with Process Explorer.
|
|
|
|
|
Also check the max page file size (My Computer -> Properties -> Advanced -> Performance -> Settings -> Advanced -> Virtual Memory) and see if you are close to that limit (Task Manager -> Performance -> PF Usage).
|
|
|
|
|
It's helpful to call the Dispose () method on large objects (like bitmaps) that your program no longer needs. This allows .NET to use memory more efficiently.
Also see the standard dispose pattern. Here's a good discussion of it: http://www.codeproject.com/KB/dotnet/idisposable.aspx[^]
|
|
|
|
|
Hi, i discoverd the DebuggerDisplayAttribute don't work in Visual Studio 2008, at leat in mine.
In Visual Studio 2005 did that work
[DebuggerDisplay( "{FirstName} {LastName}" )]
class Person {
public String FirstName { get; set; }
public String LastName { get; set; }
}
i searched for that problem already but i didnt found something about that.
That why my question: Can you acknowledge that bug ?
|
|
|
|
|
MarkPhB wrote: In Visual Studio 2005 did that work
I noticed that too, personally I just override ToString()
|
|
|
|
|
Ok and how do we inform Mircosoft about that bug ?
|
|
|
|
|
IIRC: connect.microsoft.com
|
|
|
|
|
Hi All
I wount to use the HASP Security Device By Using C#.Net .
But I Dont Know How i Can Use It .
How can hellp me About US .
if Any body have Dll About it Sent it To Me .
Thanks for any body hellp me
Thaer
|
|
|
|
|
|
I have declared an internal class to store the functions of the MFC DLL
internal static class Translate
{
//Importing unmanaged Translation DLL
#region Translation DLL
[DllImport("ECTalc.dll", ExactSpelling = false, EntryPoint = "EC_newInstance")]
public static extern int EC_newInstance();
[DllImport("ECTalc.dll", ExactSpelling = false, EntryPoint = "EC_initSys")]
public static extern int EC_initSys();
[DllImport("ECTalc.dll", ExactSpelling = false, EntryPoint = "EC_quit")]
public static extern void EC_quit();
[DllImport("ECTalc.dll", ExactSpelling = false, EntryPoint = "EC_destroyInstance")]
public static extern void EC_destroyInstance();
#endregion
//endregion
}
After which at a point, I have these two statements:
Translate.EC_newInstance();
Translate.EC_initSys();
However when my program loads, Translate.EC_newInstance(); is able to load but not Translate.EC_initSys();
The given error is as follows : "Error reading system data files. Please reload the files."
Could anyone enlighten me on this problem?
|
|
|
|
|
Sounds like a path or something is not setup correctly. Either way, the issue seems to come from the ECTalc.dll, so ask the authors of that what the issue is.
|
|
|
|