|
I didn't notice.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi,
I'm using ASP.NET and C#.NET 2. I have to dynamically display all hubs for a given hub group. A user selects the hub group from a drop down, and all the related hubs load, with a textbox next to it. The id of the textbox will depend on the id of the hub, so if the hub ID is 2, then it's corresponding textbox name will be txtHub2.
This my table where I have a label control. The label control will contain all the <tr></tr> and <td></td>.
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<asp:Label id="lblHubCommissions" runat="server" />
</table>
In cboHubGroup_SelectedIndexChanged(object sender, EventArgs e) event handler I have the following:
string strHubs = string.Empty;
List<Hub> lstHubs = Hub.GetHubsByHubGroupID(Int32.Parse(cboHubGroup.SelectedValue));
foreach (Hub h in lstHubs)
{
strHubs = strHubs + "<tr>" +
"<td width=\"30%\">" + h.HubName + "</td>" +
"<td width=\"70%\">" + "<asp:TextBox id=\"txtHub" + h.HubID + "\" Columns=\"35\" MaxLength=\"50\" CssClass=\"InputText\" runat=\"server\" /><br />" + "</td>" +
"</tr>";
}
if (strHubs != string.Empty)
lblHubCommissions.Text = strHubs.Substring(0, strHubs.Length - 2);
else
lblHubCommissions.Text = "No available hubs.";
The textboxes don't wan't to display. But if I view the source then it is there. Why is this?
Regards,
ma se
(South Africa)
|
|
|
|
|
hi all,
i have 2 buttons on a simple form.
both do different things.
but i want button2 to be treated as if its clicked if i click on button1.
how can i do this ?
|
|
|
|
|
what i got is you want to click the button 2 when u click button 1 if its the case
then just call button two click event on the button1 click event
private void button1_click(Object Sender, Args e )
{
Button2_click(sender, e);
}
in heading you are saying enabling for enable u can use the property
button1.enabled=true or false.
hope this will help you.
Naveed Kamboh
|
|
|
|
|
What do you want exactly?
If you want to enable a button, just call button2.Enabled = true , where button2 is your button variable.
If you want to call the same code for button 1 and 2, just do something like this:
private void button1_Click(object sender, EventArgs e)
{
button2_Click(sender, e);
}
and vice versa.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
or
private void button1_Clicked(object sender, EventArgs e)
{
button2.PerformClick();
}
|
|
|
|
|
Sir,
if any one could tell me how to insert a row in the datagrid
dynamically. with the click of a button
and
if i have 5 rows in datagrid and i want to store all the rows in the database
how to do that
Thanks
Plese Read it
|
|
|
|
|
One of the simplest ways to do this is to insert a row into the data source that drives your grid. in the button click event, add a new row to your data source (not in the database, in memory) and rebind to the data grid. For example, if you were going to use a DataTable as your source:
DataRow newRow = myTable.NewRow();<br />
<br />
myTable.Rows.InsertAt(newRow,index);<br />
myGrid.DataSource = myTable;<br />
myGrid.DataBind();
This also gives you a placeholder to store the data that is being edited by your data grid (assuming your data grid is being used to edit data). When submitting multiple rows to a database, I will typically submit the data as XML to a stored procedure and then let the stored procedure handle the inserts/updates. This assumes you are using MS SQL, Oracle, or another XML aware data source. If you are not,create a transaction (assuming your data source supports transactions), walk through each row of your data source and perform your insert/update, and commit the transaction.
Jim Conigliaro
jconigliaro@ieee.org
|
|
|
|
|
Sir,
I am uploading a file and sending it with the mail
What i want is that i want to show the file as a hyperlink and on click of the link the file should be opened automatically.
It is a web based project(means file can be opened in sone other computer)
so how should the link for download a file as hyperlink should be given
Thanks
Plese Read it
|
|
|
|
|
Hi,
I'm trying to create a new row and add values to the column in the below code.
But it throws exception called "Update unable to find data table 'Table' or Tablemapping 'table' ".
DataSet dset = new DataSet();
SqlCommand dbcommand = new SqlCommand();
dbcommand.CommandText ="select * from DBTable";
dbcommand.Connection = myConnection;
SqlDataAdapter dbDA = new SqlDataAdapter(dbcommand);
dbDA.Fill(dset, "DBTable");
DataTable dbtable = dset.Tables[0];
// dset.Tables.Add(dbtable);
DataRow row;
row = dbtable.NewRow();
row["Name"] = DBfile;
row["Meters"] = IMeter;
dbtable.Rows.Add(row);
dbDA.Update(dset);
any solution? or let me know how to create a new row and assign values to the columns.
|
|
|
|
|
It had happend to me some times ago.
I used mapping table name as "Table" then it was sorted.
when you query then it doesn't understand or pick the table name.
it might help you also.
Naveed Kamboh
|
|
|
|
|
sorry !!
Plz can you tell me in the code where and what i have to change?
The problem is i'm new to c# .
|
|
|
|
|
|
Hi!
I'm looking for a library or API that can help me to extract video component such as I-Frame, P-frame.
As a matter of fact, I would like to modify the DCT of I-Frame of a MPEG4 video file.
Thanks
|
|
|
|
|
You could have searched for it here[^].
-- modified at 5:44 Wednesday 17th May, 2006
|
|
|
|
|
How can i add scroll bar to my form?
|
|
|
|
|
Set the forms AutoScroll property true and make the form so small that at least one control is located outside the form's client region.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
hi all,
i am trying to write a code:
first i want to operate code segment X then wait for 10 miliseconds then go to next step which is operating code segment Y and this time my program has to wait for 100 miliseconds before starting to process code segment Z.
how can i do this with C# ?
|
|
|
|
|
Hi,
Thread.Sleep(milliseconds);
|
|
|
|
|
Thread.Sleep(millisecconds)
|
|
|
|
|
hi all,
i have a msaccess database with 3 fields 'case', 'dateopened' (day,month), houropened(hour,minute,second) and 'whoopened'.
i have such a data text:
******************** CASE OPENNING RECORDS OF 80 ENTRIES ********************
***************** (MONTH/DAY-HOUR:MINUTE:SECOND-#AUTHORITY) *****************
------------------------------- CASE NO: 9876 -------------------------------
05/12-17:25:05-#3 05/12-17:24:56-#3 05/12-17:24:44-#0 05/12-17:24:32-#3
05/12-17:24:22-#3
---------------------------------- DATA END ---------------------------------
how can i parse this text and get case No and other datas from ?
many thanks in advance.
bye.
|
|
|
|
|
Well, it depends on if you can format the text as you want..
If your text is a bit small (something like few kilobytes), and performance is not an issue here you may want to directly use the (IndexOf) function to locate cretain Keywords (eg. "RECORDS OF ", "CASE NO: ", or "DATA END"), also then you may reformat your data text to be something like this:-
[CASEOPENNING] [RECORDSOF] 80 [ENTRIES]
[DATA]
[CASE NO]9876[/CASENUMBER]
05/12-17:25:05-#3[NEWENTRY]05/12-17:24:56-#3[NEWENTRY]05/12-17:24:44-#0[NEWENTRY]05/12-17:24:32-#3
[NEWENTRY]05/12-17:24:22-#3
[CASE NO]6675[/CASENUMBER]
05/12-17:25:05-#3[NEWENTRY]05/12-17:24:56-#3[NEWENTRY]05/12-17:24:44-#0[NEWENTRY]05/12-17:24:32-#3
[NEWENTRY]05/12-17:24:22-#3
[/DATA]
where you can look to for the index of "[NEWENTRY]".
Then it's easy!!
If your text data is a bit large & you want to boost the performance you may want to try the "ReadLine" function to read your text line by line. Then in the read text parse it with (IndexOf) in a way similar to the above.
There are many other ways to parse and format any text. This was merely a suggestion , Good luck.
|
|
|
|
|
I have image "name.ico", this image have size by ACDSee
48x48x24b;
48x48x256;
32x32x24b;
32x32x256;
16x16x24b;
16x16x256.
I use this code (MSDN):
System.Net.WebRequest request = System.Net.WebRequest.Create("http://.../name.ico");
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream responseStream =
response.GetResponseStream();
Bitmap bitmap2 = new Bitmap(responseStream);
PictureBox1.Image = bitmap2;
this code show image 48x48.
but i need show 16x16x24b.
How to do this?
Please help me!
-- modified at 3:58 Wednesday 17th May, 2006
|
|
|
|
|
Hi,
haven't tested it but you could try:
Icon icon = new Icon(responseStream, 16, 16);
Bitmap bitmap2 = icon.ToBitmap();
This should give you an Icon with 16x16 size but I don't know which color depth will be used...
Probably looking at MSDN[^] would also be a good idea.
|
|
|
|
|
I write next code:
System.Net.WebRequest request = System.Net.WebRequest.Create("http://microsoft.com/favicon.ico"); this image is Ok!
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
Icon icon = new Icon(responseStream, 16, 16);
Bitmap bitmap2 = icon.ToBitmap();
TabPage1.Image = bitmap2;
it is don't work
in this line error
Icon icon = new Icon(responseStream, 16, 16); ->This stream does not support seek operations.
but:
Icon icon3 = new Icon("D:/Program Files/EasyPHP1-8/www/e107n/favicon.ico", 16, 16);
Bitmap bitmap3 = icon3.ToBitmap();
TabPage2.Image = bitmap3;
is work (16, 16: Ok)
how to fix this problem?
I need load image from Internet.
|
|
|
|