|
Just because the DataColumn class doesn't have such a property doesn't mean there is now way to get this info...
Robert
|
|
|
|
|
Robert Rohde wrote: doesn't mean there is now way to get this info...
And what other ways do you know to get that information? Also when you make a Sql table where do you put that information?
Regards
|
|
|
|
|
Dear Nade Elshahabi
Please don't answer your friend's questions with an another question and let others to help and show the best way.
I had a code to fetch database informations, but i lose it in my harddisk.
If you don't have information about a subject you don't have to answer.
I know you want to help, but others me be think, my problem have been solved.
Regards
|
|
|
|
|
freshonlineMax wrote: Please don't answer your friend's questions with an another question
I wasn't asking for an answer. I was proving my point of view that there is no description for Sql columns. If Robert knew how to get it he would have posted the answer. BTW where did you put that description anyway?!!
freshonlineMax wrote: I had a code to fetch database informations, but i lose it in my harddisk.
Database information?? You mean that present in the INFORMATION_SCHEMA? Check the INFORMATION_SCHEMA.COLUMNS table and see if it has a description field!!
freshonlineMax wrote: If you don't have information about a subject you don't have to answer.
freshonlineMax wrote: I know you want to help, but others me be think, my problem have been solved.
Sure! And forgive me -turely- if I blocked someone else from answering you. Your post is still there. He who has answer, let him benefit us all!!
-- modified at 14:26 Saturday 28th October, 2006
Regards
|
|
|
|
|
Hello Again
Dear friend 'Nader Elshehabi'
I solve my problem my self!
Now i can help myself, you(if agree) and others (if it's useful!)
Just run below query in sqlServer:
SELECT objtype, objname, name, value
FROM ::fn_listextendedproperty(NULL, 'user', 'dbo', 'table', 'YourTablename', 'column', DEFAULT) AS fn_listextendedproperty_1
If we want to get special column's description, we should type column's name instead of 'DEFAULT'. Field 'value' refers to column's description.
Regards
|
|
|
|
|
Hi,
maybe this[^] is a good start.
Robert
|
|
|
|
|
you can retrieve data from SQL select :
select b.name,c.value from syscolumns b, sysobjects A,sysproperties c where a.name ='bed' and a.id=b.id and b.id=c.id and b.colorder=c.smallid
then use this rows to modify your datagridview column tex
if you can design this, i may design class for you:
SetDatagridColumnTextBySqlDescribe(DatagridView dview)
Think ...
|
|
|
|
|
Hi all,
Can anyone tell me how do we create minidumps for crashes and hangs in windows applications c#.net 2.0.
I have used ThreadException handler and AppDomain.CurrentDomain.UnhandledException handler to catch exception and log the information.
But what can be done in case of a crash or hang in application.
Can i use ADPlus for this, if so how to implement it??????..........
Thanks,
Pranu.
|
|
|
|
|
If your program crashes you won't be able to use it to dump its own memory now, would you?
Anyway, if you implement exception catching well in your program, it shouldn't crash or hang -specially in a managed environment like .Net where you can't screw up with pointers-, it's unhandled exceptions that makes your program crash, and windows Xp or later provides an automatic memory dump for your application. Most user won't know how to extract the data from the report and send it to you, but if Hex dump is one of your favourite languages you can simulate the scenario and read it as you please -not convenient as you can see-.
pranu_13 wrote: Can i use ADPlus for this, if so how to implement it??????
Read this[^].
Regards
|
|
|
|
|
Hi
I have 2 page 1)Master 2)Pop-Up(window.open). Now i open 2 of this master page. From 1 of them i open this popup which is part of same session and copy the url and past it in other opened master page which has different session. Now if i press Go the the current session is being modified by the popup-ups session.
Why is it so ?? Why session variable become null. I have checked google and taken all possible measure still no luck.
Pls help me.
Thanks in advance.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
How can I open a file (e.g pdf) with its default program (e.g acrobat reader) in C#?
Thx
Ed
|
|
|
|
|
Process.Start(filePath);
"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
|
|
|
|
|
Hello
I wrote a multithreading program in vs2003 that don't work in vs2005.
Now I want to write multithreading code with backgroundworker.
But all samples in the web confusing me and i can't understand them!
Please help me to write a simple program to do this :
1-Button 2-TextBox 3-ListBox
By pressing Button, ListBox should fill as equal as TextBox's number.
Button1_Click()
{
for (int i=0;i<convert.toint16(TextBox1.text);i++)
{
ListBox1.items.add("Item #" + i.tostring());
}
}
But i want to do this with BackgroundWorker, So i'll have ability to create second set of this controls on my form to work parallely.
Just give me a simple code for first section.
Tank You
|
|
|
|
|
IMO background worker is quite useless if you already know how to do multithreading yourself. You did it in 2003 you can do it in 2005.
freshonlineMax wrote: don't work in vs2005.
Define "don't work"? What error do you get, and what code do you use?
About your issue if you want to manipulate a control from another thread simple use Control.Invoke() method. ie. Put the above code in a method, and call it from the other thread using Invoke() .
Regards
|
|
|
|
|
Hi,
accessing controls from another thread can result in weird errors. You could use Invoke but I think in this case that doesn't make sense. I suppose this operation takes a while. To shorten this time make sure that ListBox.Sorted is set to false. Second first create a array with all your elements and then use AddRange. That should improve your performance to an extend where threading is hopefully not required anymore.
Robert
|
|
|
|
|
Dear robert Rohde
Thanks for advice, but filling ListBox is not my problem. I wanted it, just for an example of BackgroundWorker. Please if you have easy example about BackgroundWorker help me about this. I really want to know it's functionality.
Regards
-- modified at 14:03 Saturday 28th October, 2006
|
|
|
|
|
 Hi,
as said you should find an example where no GUI manipulation is involved. You could make some heavy operations in the thread. Make a Form with a ListBox, two Buttons, a BackgroundWorker and a Progressbar and add the following code:
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
progressBar1.Value = 0;
progressBar1.ForeColor = Color.Green;
backgroundWorker1.RunWorkerAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
CalcPrimes(10000000, 10005000, e);
}
private void CalcPrimes(int start, int end, DoWorkEventArgs e)
{
for (int i = start; i <= end; i++)
{
if (backgroundWorker1.CancellationPending)
return;
bool isPrime = false;
if (i % 2 == 1)
{
isPrime = true;
for (int j = 3; j < i / 2; j++)
{
if (i % j == 0)
{
isPrime = false;
break;
}
}
}
int p = 100 * (i - start) / (end - start);
backgroundWorker1.ReportProgress(p, isPrime ? i : 0);
}
}
private void button2_Click(object sender, EventArgs e)
{
progressBar1.ForeColor = Color.Red;
backgroundWorker1.CancelAsync();
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
int primeNumber = (int)e.UserState;
progressBar1.Value = e.ProgressPercentage;
if (primeNumber > 0)
listBox1.Items.Insert(0, primeNumber);
}
This should be a typical scenario for the BackgroundWorker. Don't forget to bind all eventhandlers.
Robert
|
|
|
|
|
Hi
Dear Robert
I got error for below line in "CalcPrimes()" :
backgroundWorker1.ReportProgress(p, isPrime ? i : 0);
error says that : "This BackgroundWorker states that it doesn't report progress. Modify WorkerReportsProgress to state that it does report progress."
Anyway, So thanks to spending your time for solving problems.
Regards
|
|
|
|
|
Hi,
there are two properties on the BackgroundWorker you need to set to true. I think they are call SupportsCancelation and ReportsProgress or something similar.
Robert
|
|
|
|
|
Hello professor Robert
Program was solved successfully.
I found my problem and as you said i should set backgroundworker properties to "True".
Thank you;)
|
|
|
|
|
Hello,
In my Win Form, I have We browser control and sometimes I am getting error like following
:
" Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore
function. "
Can you please give me an idea why I am getting this error ?
Thanks
Emran
|
|
|
|
|
Hello
In what line of code do you get this error? And you said "sometimes"? What about "othertimes"? What do you do exactly to get the error -ie. under what conditions-?
PS.
Take a look at this link[^]. Specially the first hit.
Regards
|
|
|
|
|
Hi Nader,
Thanks for your information. Actually this error is coming magically sometimes.... not all the times... and I have no idea from which part of the code is throwing this error. I thought may be this error is some thing common to DataGridView, now it looks like, My guess is wrong. I will do some more research on it.
Thanks again
emran
|
|
|
|
|
I want to be able to hold the down arrow key to continue to scroll on a custom control that I've written.
How do I check for a key being held down? Is there a property or something to let a keydown event repeat itself?
|
|
|
|