|
I've made a small deployment project. in that when i am trying to rollback installation if serial number entered for that by a user is wrong then i recieving an exception as "saved state got corrupted.100 % restoration won't be done". How to get rid of this exception and rollback the installaion too.
manu sharma
|
|
|
|
|
I have developed a software that takes text documents as input and after performing a few steps it generates an inverted index....and it takes a little time to do so and i want to display a percentage progress as text label.....and i ve calculated the time taken by each step in this and then changed that time into to percentage and displayed it after the button click.....but the problem now is that when i change the input files this percentage starts to look stupid.....so i want to ask that how can i calculate the percentage wich will work for all inputs..........
Looking forward for help
Regards,
|
|
|
|
|
Okay
That's for sure a bad idea to do the time calculation since for the same file, on different machines of different speeds or even in your own machine when it is busy, times may take shorter or longer....
The idea is simple: you should make get to know the size of the input file (in characters, bytes etc.) and then simply check where you are processisng now... For example if the file is 100 characters long, and you are now processing the 23rd character, you are at 23% of your process....
Hope this could give you the idea....
|
|
|
|
|
Sir the real problem is that i m reading about 350 files and i m performing one step at a time ist i read all the files then in the next step i remove the white spaces from it in next step i remove some unecessaray words from this dataset and few more steps like that i m doing it this way that i ist checked the total execution time of the program then i checked that how much time each of these steps take and then i divided that into percent of total time and then in each step i checked on the basis of all the files present and the file already processed......i hope u understand the problem now
looking forward for help
Regards,
|
|
|
|
|
Are you saying that you are looping through the files for EACH step? If so you are probably executing more loops which in itself will slow down.
Prev poster is correct though, you CANNOT make a decision based upon time of execution, it just won't work for every (many) circumstances.
BTW, I'm still unclear of what you're really trying to do!
|
|
|
|
|
1.I have a table(with 1 row) and i whant do create as many labels as columns.
Each label has to have the text equal to a column name and the position:
x:24 for everyone and label1 y = 60 label2 y = 120 label3 y= 180 and so on.
All this has to be made throw c# code.
2. How do i put the text from a textbox in a table?
PLZ HELP
|
|
|
|
|
what do you mean with table a dataTable object or a database table?
If it is a database witch kind of database and how do you connect with it?
anyway. you can get the label property text and with it do and update if it is database table:
"alter table 'tablename' add column (label.text.toUpper() datatipe(length))"
if you are talking about a datatable is even easier
datatablename.columns.add("label.text");
hopefully it will help you
NOthing by now;)
|
|
|
|
|
10x
table object.
but how do i create as many labels as column whit the propety label1.text equal to evry column name.
ex: label1.text = the name of the first column from the table.
can anyone write the code for this.
|
|
|
|
|
//i have not tryed the code so it might have some errors but i think you can get the idea
//SQL_COMMANDS (this commands will work only if you have a SQL Database)
//this command will return all the non system tables
SELECT Table_Name AS NOMBRE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE '
//this will return all the column names from a given database and table
SELECT COLUMN_NAME as column FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME
string Query = "SELECT COLUMN_NAME as column FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME LIKE 'the_name_of_your_table'
//first you have to get all the column names of your table
Cache = new System.Data.DataSet();
using (SqlConnection Conn = new SqlConnection(this.Conexion))
{
SqlDataAdapter SqlDs = new SqlDataAdapter(Query,Conn);
Conn.Open();
SqlDs.Fill(Cache,NombreTabla);
}
//now you have all the column names and you have to iterate as many times as columns you have creating and adding to your form a lavel
//note that in your case the location will have to be assign dinamicly
foreah(DataRow row in Cache.DataTable["NombreTabla"].rows)
{
System.Windows.Forms.Label MyLabel = new System.Windows.Forms.Label();
MyLabel .Location = new System.Drawing.Point(64, 64);
MyLabel .Name = row[0].tostring();
MyLabel .Size = new System.Drawing.Size(376, 64);
MyLabel .TabIndex = 0;
MyLabel .Text = row[0].tostring();
//here we add the new label to the form
this.controls.add(MyLabel)
}
//i hope the code above can help you
NOthing by now;)
|
|
|
|
|
Hi everybody
First i need to now if in a given intranet there is a domain server and if yes be able to connect to it in order to get information about the domain.
I've been looking for this but i've not find anything about.
My code is done in C# using the 2.0 framework, but any help even in other language will be great
pleeeease. anyone can help me??
thanks everyone.
NOthing by now;)
|
|
|
|
|
Not an AD expert by any means, but have been doing somework with it lately.
Doing a dsquery server on the command line will return a list of comain controllers for your domain. I think this is a subset of cn=configuration,dc=yourdomain,dc=com. Of course, if you have no DC, that will not work .
Ryan
"Michael Moore and Mel Gibson are the same person, except for a few sit-ups. Moore thought his cheesy political blooper reel was going to tell people how to vote. Mel thought that his little gay SM movie about his imaginary friend was going to help him get to heaven."
- Penn Jillette
|
|
|
|
|
i am working on windows application. i have used cystel report in my program. and using microsoft access as a database.i have put password on access file. problem is that every time i press on button to open crystel reports database login dialog appears.it asks for login id and password. by putting these report work fine.
i don'nt want this database login dialog. but i also don'nt want to remove password from database.
what code i should make so that database login not appear and crystel report work fine without entering password again and again
Amit Grover
CDAC R&D
|
|
|
|
|
Is it have any Optional parameter in C#
If it have, How to declare in a method
Tell me please\\
thanx
-
|
|
|
|
|
Nope, they took out optional parameters for C#.
Instead you have to make multiple overloaded methods, each for which ever parameters you want to use.
|
|
|
|
|
public void MyMethod() {
// for example you can call your second function
MyMethod(true);
}
public void MyMethod(bool param1) {
// for example you can call your third function
MyMethod(param1, "");
}
public void MyMethod(bool param1, string strParam2) {
// do something
}
now you just can call the method by
MyMethod(); //or
MyMethod(oMyVar); //or
MyMethod(oMyVar, strMyString);
this is a good way to do this.
|
|
|
|
|
Hi,
I have two problems.
first, I am looking for some API or library in C# that can help me to extract the motion vector stored in the MMEG4 video files.
Secondly, I am also looking for the API that construc a MPEG4 video file with the I-frame and motion vector.
Thanks for your help.
|
|
|
|
|
FFmpeg and Xvid are opensource projects. They are the only ones I can think of.
|
|
|
|
|
I've added a table and a couple of textboxes dynamically to my .aspx page.
When I want to loop through the controls on the page, it just displays the text "control", irrespective of how many text boxes were generated.
Here is my loop to display the controls:
protected void btnInsert_Click(object sender, EventArgs e)
{
foreach (Control control in Page.Controls)
{
if (control.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
{
Response.Write("contol " + control.ID + "<br />");
}
}
}
Please can someone help.
Regards,
Brendan
|
|
|
|
|
Hi,
Have you verified that whether you are having the TextBox control in Page.Controls, because i have used like this and this is giving me correct result:
foreach (Control control in Page.Controls)
{
if(control.GetType().ToString()=="System.Web.UI.HtmlControls.HtmlForm")
{
for(int i=0; i<control.Controls.Count; i++)
{
if(control.Controls[i].GetType().ToString()=="System.Web.UI.WebControls.TextBox")
{
Response.Write(control.Controls[i].ID + "<br>");
}
}
}
}
Hope this will help you.
Best Regards,
Apurva Kaushal
-- modified at 7:31 Friday 19th May, 2006
|
|
|
|
|
Take a look at how you are adding the TextBoxes. If you're adding them to a panel or some other control that's in the Page.Controls collection, then Page.Controls won't contain your control, but panel1.Controls will (for instance).
|
|
|
|
|
Hi,
Something really weird is happeneing here, and I can't explain why.
Let me give you a brief explanation what happens. When the pages loads for the first time it loads all the hub groups into a dropdown control, that's all. Each hub group can have 0, 1, or many hubs. I don't know how many hubs there are per hub group. When the user selects a hub group, it sets a panel to true, and loads all the related hubs, with textboxes. The textboxes are generated automatically. I give the ID of each textbox "txt" plus the ID of the hub (from the database).
This is my code in the .aspx file (just some of it):
<asp:Content id="cntBodyContent" ContentPlaceHolderID="cphBodyContent" Runat="Server">
<h5>Hub Group</h5>
<asp:DropDownList id="cboHubGroup" AutoPostBack="true" OnSelectedIndexChanged="cboHubGroup_SelectedIndexChanged" runat="server" />
<asp:Panel id="pnlHubCommissions" Visible="false" runat="server">
<asp:Table id="tblHubCommRates" BorderWidth="1" Width="100%" runat="server"></asp:Table>
<asp:Button id="btnInsert" Text="Insert" CssClass="FormButton" runat="server" OnClick="btnInsert_Click" />
</asp:Panel>
</asp:Content>
When I generate the textboxes for each hub, this is my code:
string strHubs = string.Empty;
TextBox tb;
List<Hub> lstHubs = Hub.GetHubsByHubGroupID(Int32.Parse(cboHubGroup.SelectedValue));
foreach (Hub h in lstHubs)
{
TableRow tRow = new TableRow();
tblHubCommRates.Rows.Add(tRow);
TableCell tCell1 = new TableCell();
TableCell tCell2 = new TableCell();
tCell1.Text = "<h5>" + h.HubName + "</h5>";
tCell1.Width = Unit.Percentage(15);
tRow.Cells.Add(tCell1);
tb = new TextBox();
tb.ID = "txtHubCommRate" + h.HubID;
tb.Width = Unit.Pixel(44);
tb.MaxLength = 6;
tb.CssClass = "InputText";
tCell2.Controls.Add(tb);
tCell2.Width = Unit.Percentage(85);
tRow.Cells.Add(tCell2);
}
My button event handler:
protected void btnInsert_Click(object sender, EventArgs e)
{
// It does nothing yet
}
Everything displays well, 100% in fact. But this is where I am having my problem. When I click on the buttion, then table with the results generated disappears. Not sure why this happens. This is why I think it can not display the controls, because it is not there. Is there a reason for this??
I hope someone can help. If I have left out something, please let me know. If I can get this to work, then I can think about trying to display the textbox values.
Regards,
ma se
|
|
|
|
|
can anybody tell me
How to Increase the header height of datagrid in c# windows application??
Thx
Qutub
Qutub
|
|
|
|
|
Hi
u can try b changing the proper in the property window.
The property that u've to change is "PreffredRowHeight"
Regards,
Mukesh
|
|
|
|
|
Hi, I'm new to the code project. I'm 16 and I am working on my major work for year 11. I want to make an instant messenger similar to msn, but simpler. I'm fairly new to C# and all programming, but know the basics.
I have created a form with 2 text box (tbName, tbSpeech) a list box and a send button. You type your name in to tbName and then type your message in to tbSpeech. The program then adds " Says: " to your name, then adds your name (including the extra bit) and your message to an array, the array is then displayed in the list box.
I was wondering if you could help me with the whole getting the array to display on both computers bit. I have been looking around on this site and the only way I have seen it done, is with a console program set up as a server (this was for a messenger service based on a local network).
In the final project I plan to have the main form containing a list of people logged on (being anyone who is running the program) and you can click on their names and it opens the form that I decribed earlier (very similar to msn). I need help working with the internet though. What is the best way I should go about it?
Cheers in advance guys
-- modified at 6:00 Friday 19th May, 2006
|
|
|
|
|
Hi,
have a look at this article[^]. It doesn't have really good votes because the demo and code comments are in spanish but the article is in english and should give you the basic idea.
You definitely need a server. Whether this is a console program, a service or just another mode of the client GUI doesn't matter.
|
|
|
|