|
but the tables will created on runtime....
|
|
|
|
|
OK, I've read that statement and I don't really understand what you are after. Are you trying to create a database table at runtime, or are you trying to create an HTML table? What have you actually done so far?
|
|
|
|
|
Pete is right - that makes no sense.
You have to remember that we can't see your PC, or read your mind. All we have to work with is what you have told us, and so far, that is not a lot. There are so many different meanings of "Table" within computing, that we cannot tell which one you mean. The same applies for "Generate" - you need to specify clearly exactly what you are trying to achieve, and ideally how far you have got so far.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Nice requirements !
No memory stick has been harmed during establishment of this signature.
|
|
|
|
|
for (int i=1; i<10; i++) {
outp("table of "+i);
for(int j=1; j<10; j++) {
int k=j*i;
outp(" "+j+" * "+i+" = "+k);
}
outp("");
}
is runtime
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
posixtively awesome!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
For a database table, you will need to create a DDL query to create the table, and then some Insert statements to put autogenerated number values into the table.
|
|
|
|
|
My son needed to create a table of some numbers for some homework this week, so I wrote a small WinForms app to do it. Here's a snippet:
private void DisplayTable()
{
int rows = (int) this.numericUpDown1.Value ;
System.Text.StringBuilder html = new System.Text.StringBuilder() ;
html.AppendFormat ("<html><head><title>{0}</title></head><body><table cols='{1}' width='100%' border='1'><tr><th>Row</th>" ,
this.textBox2.Text , this.columns.Count + 1 ) ;
for ( int c = 0 ; c < this.columns.Count ; c++ )
{
html.AppendFormat ( "<th>{0}</th>" , this.columns [ c ].Item1 ) ;
}
html.Append ( "<th>Total</th></tr>" ) ;
for ( int r = 1 ; r <= rows ; r++ )
{
html.AppendFormat ( "<tr><td>{0}</td>" , r ) ;
int tot = 0 ;
for ( int c = 0 ; c < this.columns.Count ; c++ )
{
int val = this.columns [ c ].Item2 * r ;
html.AppendFormat ( "<td>{0}</td>" , val ) ;
tot += val ;
}
html.AppendFormat ( "<td>{0}</td></tr>" , tot ) ;
}
html.Append ( "</table></body></html>" ) ;
this.webBrowser1.DocumentText = html.ToString() ;
}
P.S. I also have apps that generate DataTable s.
modified 25-Jan-12 11:06am.
|
|
|
|
|
PIEBALDconsult wrote: My son needed to create
PIEBALDconsult wrote: so I wrote
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Disturbingly for him, he only got a C-.
|
|
|
|
|
There was no requirement as to how to create the table, I assumed that using a computer program to do so was OK. As I didn't feel like teaching him Excel, I wrote a program that would allow him to create the table.
Furthermore, he had completed his ilegible hand-drawn table before I finished with the program anyway.
|
|
|
|
|
Yeah - but it was a woodwork class...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Well, I voted this response up, simply because I like the warm feeling of thinking about a father helping his son to code.
Depending on the age of his son, and the nature of the class, and the teacher's qualifications, and what his peers may, or may not, know, about .NET, or C#: what happens when the teacher asks him to explain his solution to the class, though
best, Bill
"Science is facts; just as houses are made of stones: so, is science made of facts. But, a pile of stones is not a house, and a collection of facts is not, necessarily, science." Henri Poincare
|
|
|
|
|
It was a math class, he simply had to produce and use a table with some numbers in it to get some values to answer a few questions. The table was only an aid to answering the questions, not the answer itself. He didn't need to code, but I had hoped that he might see how having such a useful skill could benefit him.
|
|
|
|
|
I am a beginner in asp. I have a link like some thing like this http://www.mysite.com/default1.asp?id="9" . I need to change this url into like this href="http://www.mysite.com/ar/default1.asp?id="9" on a clicking a button. Means on clicking this button it will get change the url "/ar/" and the next click it will remove "/ar/" . Please some one help me to do this.
|
|
|
|
|
You might get better responses if you post this in the ASP.NET forum.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
i need to find a "Outlook Task" with a special UserProperty like "id". I know how to find a contact with this property, but this doesn't work with a task.
Contactitem:
Outlook.ContactItem contact = (Outlook.ContactItem)contactItems.Find(String.Format("[Email1Address]='{0}' and " + "[User3]='{1}'", mail_s, master_s));
I need Help please! Thank's a lot
regards
ww
|
|
|
|
|
Hi
When I could change the text at runtime, I think the property was called Capture.
How do you do in Visual Studio 2010?
If I set the button btn's property Text to "By" and try the below
btn.Text="Hi"
nothing happens.
How do I do it nowadays
Many Thanks
Fia
|
|
|
|
|
What do you mean, "Nothing Happens".
If "btn" is a control on your form or webpage(depending on your solution type), then this will change the text shown on the button.
I think that you have not given us a clear picture of your issue. Could you describe it a little more?
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Hi again
What I mean with "nothing happens" is that the button btn's text is still By.Even if the bool folder's property Visible is changed to true. I have tried
I have the code in the buttons click event.
private void btn_Click(object sender, EventArgs e)
{
if (folder.Visible==true )
{
btn.Text = "Hi";
}
else
{
btn.Text = "By";
}
}
I have tried btn.Invalidate(); and Form1.Invalidate(); it didn't help. And I also tried with Refresh() and Update() on both btn and Form1.
Dear KP Lee
I don't understand how to or what you mean I should do
"I fixed that by assigning a delegate in the winapp, running the calculations on another thread and calling the delegate."
Many Thanks
Fia
|
|
|
|
|
I'd try to change the condition to
if (btn.Text == "By") just to try if the Text change works.
If it does, you should investigate how folder.Visible is connected to your button text.
Ciao,
luker
|
|
|
|
|
The other thing to check is that the click event is hooked to the event handler: put a breakpoint on the first line to make sure it is being executed, and then single step through.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi
Thanks for your answers.
I have already stepped through the code and it's running as it should, but the button's Text still doesn't change.
I don't understand what to do????.
Many Thanks
Fia
|
|
|
|
|
OK: I took an existing form, and dropped a button on it.
I double clicked the button and in the handler method that came up:
private void button1_Click(object sender, EventArgs e)
{
button1.Text = button1.Text == "Hello" ? "Goodbye" : "Hello";
}
When I ran the app, the button caption was "button1".
When I pressed it the first time, it changed to "Goodbye"
A second click, it became "Hello".
Third click, back to "Goodbye", and round and round.
What am I doing that is different to you, or you doing that is different to me?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi
I can't see any difference.
Here is my code.
private void btn_Click(object sender, EventArgs e)
{
if (folder.Visible==true )
{
btn.Text = "Hi";
}
else
{
btn.Text = "By";
}
}
The variable folder is just a bool variable. When I debug my code I can see that it runs as it should, but still the button's Text doesn't change.
I don't know if it has anything to do with the problem, but I have a FileLListbox and a FolderListBox from Alva on the form. Should that be the problem.
Many Thanks
Fia
|
|
|
|