|
i have employee screen its having some area hierarchy once u click on go button it displays result in datagrid.What i want is the results displyed in the datagrid to be exported to excel..how can i do this
|
|
|
|
|
|
I am binding a datatableof a dataset to a gridview.
But I want to exclude some columns from
binding. How?
string strSQL = string.Format("SELECT A,B,C,..);
MySqlDataAdapter da = new MySqlDataAdapter(strSQL,myCommand);
DataSet ds = new DataSet();
da.Fill(ds,"MyTable");
myGridView.DataSource = ds.Tables["MyTable"];
Above line, how to exclude some columns from binding to grid?
Thanks
|
|
|
|
|
You need to create and bind individual columns. Alternativley, in the design view you can specifiy columns and their corresponding datasource.
An easier way would be to only select the columns you need.
A final alternative, for those columns you do not want to see, set the width to zero.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i have employee screen its having some area hierarchy once u click on go button it displays result in datagrid.What i want is the results displyed in the datagrid to be exported to excel..how can i do this
sadfadf
|
|
|
|
|
Try not to post same thing several minutes apart and don't use words like "urgent" because most members on this site frown upon that
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi to all,
i want to create a com object but i need to have .lib file , can i
create it in c# or i must to write it in vc++ only?
so thanks
|
|
|
|
|
|
Can i develop my crystal reports using the stored procedure?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
|
I want help in accessing all the UI Elements within a form of a WPF wiindows application. Kindly help.
-----Have A Nice Day-----
|
|
|
|
|
How to assign the values from two dimensional array into list<t>class in c#.net?
|
|
|
|
|
Loads of ways.
1) Do it yourself. Create a new list. Use a foreach loop. Loop through every item in the array and add it to the list.
2) Use .CopyTo to copy it to a single dimensional array, then all .ToList on the single dimensional array.
3) If you using .net 3.5, refernce the System.Linq assembly as use the Cast method:
IEnumerable<string> asList;
asList = myArray.Cast<string>();
</string></string>
This give you an enumerable, which you can easily convert to a list if you want.
The real question is why do you want a 2d array as a list?
If you have data that is in 2 dimensions, why would you want to flatten it to 1 dimension. You can still use Foreach on a 2d array and loop over every element.
Simon
|
|
|
|
|
Hello everyone,
I want to use System.ServiceProcess in a console based application -- other than Windows Service application. But when add statement like -- "using System.ServiceProcess", there is compile error like,
error CS0234: The type or namespace name 'ServiceProcess' does not exist in the namespace 'System' (are you missing an assembly reference?)
Does anyone know the root cause and how to solve it?
thanks in advance,
George
|
|
|
|
|
You need to add a reference to System.ServiceProcess to your project.
|
|
|
|
|
Thanks Bert,
Question answered.
regards,
George
|
|
|
|
|
Hello everyone,
1.
I am wondering what is the relationship between various C# XML types (e.g. XMLWriter, XPath, XMLDocument, XMLSerializer, etc.) and MSXML package? Does all the types just wrap and call the functons in MSXML package?
2.
When install .Net Framework Runtime, MSXML will be installed automatically?
thanks in advance,
George
|
|
|
|
|
George_George wrote: various C# XML types (e.g. XMLWriter, XPath, XMLDocument, XMLSerializer, etc.)
They are .NET framework classes and not C#. I don't know what you are asking. MSXML is a separate SDK which will be useful for JScript users.
2 - I think so.
|
|
|
|
|
Thanks N a v a n e e t h!
You mean MSXML is a separate thing and has nothing with CLR XML related function (no dependencies)?
regards,
George
|
|
|
|
|
Yep, you can use MSXML with C#, but then you have to deal with all of it's problems, which are normally worse than what you are trying to avoid.
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Thanks Spacix,
I am still a little confused. Does the C# XML classes (in more details CLR) dependent on MSXML? Or they are separate things (products/SDKs)?
regards,
George
|
|
|
|
|
They are 100% separate things, MSXML is legacy XML interface from a while back build into IE5.5 and still used for XML DOM in JScript along with MSHTML.
Most people have used Msxml2 if you've messed with AJAX in IE.
System.XML and MSXML are incompatabale data types. I don't know of, nor heard of a way to Marshal from one to the other.
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Thanks Spacix,
Question answered.
regards,
George
|
|
|
|
|
I am maintaining some code in C# and I just came across "??" used in code:
string result = (_price ?? 0).ToString("C");
What does "??" mean in C#?
|
|
|
|
|
Check this
http://weblogs.asp.net/mikaelsoderstrom/archive/2008/01/02/tip-of-the-day-double-question-mark.aspx
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|