|
If you are using .net framework 3.5 then use LINQ as follows
var query = (from c in dt.AsEnumerable() select new { FirstName = c.Field<string>("FirstName"), LastName = c.Field<string>("LastName") }).Distinct() ;
It will give you distinct values.
himanshu
|
|
|
|
|
im working on ADO.net not LINQ
|
|
|
|
|
Hi Aijaz,
But if you are working on framework 3.5 then you can use the code i have posted above.
If not then you might be need to create dataview and then filter rows from there.
himanshu
|
|
|
|
|
|
You can try hashtables for doing this.
But the best way is to change the display at runtime by merging the cells in gridview.
You can have a look at this:
http://forums.asp.net/p/1053747/1494505.aspx[^]
Regards,
Kaushal Arora
Mark as Answer if it Solved Your Problem.
|
|
|
|
|
how can i create table in 1 database 2 another database in vb.net
|
|
|
|
|
ganesh das wrote: how can i create table in 1 database 2 another database in vb.netFrown
First of all, How does it related with ASP.NET? This is ASP.NET Forum !
You want to implement using Code ? or you can implement it in Database itself.
|
|
|
|
|
Hello everyone.....I m developing an online shopping website.....and in its control panel i have give categories and sub-categories......IS IT POSSIBLE TO BUILD AN NEW GRID VIEW ON SELECTION OF EXISTIN GRID VIEW'S ROW..........PLZ GUIDE ME..........THANX
|
|
|
|
|
yes, it is possible,
on RowEditing event, get the primary key value and assign it to the query and set the datasouce to the new grid view....
|
|
|
|
|
|
Hello all,
I need to customize my reports where in I can make a selection of a from date and a to date from 2 calendars and select the appropriate process from a dropdown list in the webform and the pass it to the report using report viewer for the same .Can You please give me a detailed procedure or if possible the code for this??
|
|
|
|
|
Take a blank .rdlc (report1.rdlc).
create .xsd file (say dsReport.xsd).
Create datatable in dsReport (say dtReport).Include (or create manualy) fields required in the datatable,dtReport. Drag those fields in ur rdlc.
in code behind
using Microsoft.Reporting.WebForms;
reportViewer1.Visible = true;
reportViewer1.ShowToolBar = true;
reportViewer1.SizeToReportContent = true;
reportViewer1.LocalReport.ReportPath = "report1.rdlc";
reportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
DataTable dtReportSource = DisplayReport(fromDate,todate,process);
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsReport_dtReport", dtReportSource ));
|
|
|
|
|
What is mask field and how it can be used for date format.
|
|
|
|
|
|
The specified display mode is currently disabled on this page. Make sure personalization is enabled for the current user.
Parameter name: value
iam getting this error when iam using webparts
|
|
|
|
|
What you are trying to do with web parts ? Did you set the Display mode for it?
|
|
|
|
|
i want to implement webparts in my project where my project is an windowns authentication mode..i have declared personalisation provider for sql when iam running the project with code iam not getting the error but when run my project through iis iam getting this type of error
|
|
|
|
|
|
I have a site on production server which creates its menus from web.sitemap. earlier it was working fine but after the last update i am not able to enter into the site and this is the error i am getting
The XML sitemap config file web.sitemap could not be loaded. The operation has timed out
but same site when configured on another server is running fine.
how can i get the site running on the production server again.
|
|
|
|
|
Is there any thing change in that XML file?
|
|
|
|
|
Hi, everyone, I just started asp.net and wonders is there anyway to make a asp:textbox to be able to put images, bulletpoints, like blogger.
Thank you for guidance
|
|
|
|
|
Short answer, no. You can however create your own control based on textbox to add the features you want.
only two letters away from being an asset
|
|
|
|
|
|
Hi
i have a webPage to display some values which come from database. some fields in my database have money dataType, hence it displays in textBox like this :
61.00000
my question is that how to format this value ? for exmaple i want to display it like this :
61 or 61.00
any help would be great appreciated.
Thanks
|
|
|
|
|
Hi, hdv212, there are 2 ways of doing this
One way is done at the database side. Use the convert function to convert your values to 2 decimal places before it is being passed to your asp.net webpage
For example:
use Test2
select Convert(decimal(7,2),moneyPrice) from test1 where id=1
Another way is to use casting in asp.net :
assuming variable x is your 61.00000
double y = (int)x - x
if (y !=0)
{
int decValue = (int)y*10 ;
double backToDecimalPlaces = (double)decValue/10;
x +=backToDecimalPaces;
}
|
|
|
|