|
I am new to asp.net. Iam developing a webapplication in which i use a dynamically generated table control. I add rows into it, according to the data retrieved from the database. but when i try to resubmit the values in the table to the database, only the value in the last row is getting submitted. How can i sort out this problem??
|
|
|
|
|
I guess you're new to these forums too. Please ask ASP.NET questions in the ASP.NET forum, and there only.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi all,
Suppose i have 5 text boxes among all , i want to edit first two with some special condition rest are can be edited when form load ... so while loading am setting some default value bit dont want to edit first two text box so what the property or code need to be applied here ..
textbox1.disabled could work but i dont have disabled property here ...
please help me ..
vikas da
|
|
|
|
|
Thank all who looked into my problem ...i got the solution textbox1.ReadOnly=true
vikas da
|
|
|
|
|
Use a maskedtextbox.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi,
I'm adding a button to an existing app. I need to open a new window once this button is clicked. The new button has been added to an existing User Control and takes on all the attributes of the other buttons. Great.
I need to add an onClick event to my button in the code behind that will open a new browser via some javascript (window.open). When I add it it and run the code it renders the button with 2 onClick events (1 from the global attributes of the user control I guess) My onClick doesn't funtion (not a shock) I know I can have 2 functions running on 1 onClick - I separate with a semi-colon - how do I merge my onClick event into the existing one? Attribute.Add("onClick"),myButton creats a new one.
Any ideas welocme !!
Thanks
|
|
|
|
|
I'm glad you said code behind, or I may not have worked out that you're in the wrong forum. ASP.NET questions go in the.....
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I'm glad when I said code-behind I meant C#, i'll keep it here..
|
|
|
|
|
How can i get all the machines IP of my LAN.
modified on Wednesday, July 9, 2008 7:40 AM
|
|
|
|
|
Get the network mask of your current IP, then enumerate through all the combination's in your subnet pinging each one for a response.
If you have no idea what I am talking about, read up on how IP networks work.
|
|
|
|
|
string hostname = Dns.GetHostName();
IPHostEntry ipentry = new IPHostEntry();
ipentry = Dns.GetHostEntry(hostname);
IPAddress[] ip = ipentry.AddressList;
for (int i = 0; i < ip.Length; i++)
{
string d = ip[i].ToString();
}
I found this program, will u tell me any other option
i have checked the command
net view
it displays all the machines of ur network
some thing like that i want to make
|
|
|
|
|
Hello everyone,
When executing !bpmd command in WinDbg, there is error like this, any ideas?
(there is no such error, if I start to run the application, and break in the middle of running, then type !threads again. My purpose is to use !bpmd command to set breakpoint before the application runs, so this situation makes me inconvenient.)
0:000> !bpmd
Failed to find runtime DLL (mscorwks.dll), 0x80004005
Extension commands need mscorwks.dll in order to have something to do.
thanks in advance,
George
|
|
|
|
|
Sounds like .NET is not installed, or in your PATH.
|
|
|
|
|
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
|
|
|
|