.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
abhays
Clintonzz
mattyclown
cathyhill345
arronlee
Post New Web Links

How to select only one row from DataSet

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net
 

Hi,

My DataSet gives a result like this when i bind to GridView


BillNo     BillStation            Amt1         Amt2       Amt3       Amt4

Hyd

 1              Hyd                  100              50          50           25

 2              Hyd                  100              50          50           25

Bang 

 2              Bang                500            100        200           50 

 2              Bang                500            100        200           50

Delhi

 3     &n


View Complete Post


More Related Resource Links

better code for select in a typized dataset

  

hi there
i have a dataset in my project named  DS.xsd
so, i usually take a dataTable using this code:


        Dim da As New DSTableAdapters.RistorantiTableAdapter
        Dim DT As New DataTable("Ristoranti")
        Dim DR As DS.RistorantiRow()

        DR = da.GetData.Select("codRistorante=" & HID_Risto.Value)
        Dim drr As DS.RistorantiRow = DR(0)

        With drr
            If .IsCAPNull = False Then TXT_Cap.Text = .CAP
            If .IsCategoriaNull = False Then TXT_Categoria.Text = .Categoria
......

i think it is obsolete code
and i use 5 rows of code for take my data
is it correct? or may i use another approach for doing it better?


Dataset select issue

  

Hi there,

I have written some code using data sets (which i am new to). I have brought back all of the rows, which is fine, but i need to select certain customers according to if they are active

SqlConnection cnn = new SqlConnection(@"Data Source=192.168.100.2;Initial Catalog=intranet;User ID=sa;Password=xxxxx;");
        SqlDataAdapter cmd1 = new SqlDataAdapter("select * from clients WHERE active = 1", cnn);

        DataSet ds = new DataSet();
        cmd1.Fill(ds, "clients");

        SqlDataAdapter cmd2 = new SqlDataAdapter("select * from tbl_imalive", cnn);
        cmd2.Fill(ds, "tbl_imalive");

        ds.Relations.Add("myrelation",
        ds.Tables["clients"].Columns["id"],
        ds.Tables["tbl_imalive"].Columns["customerID"]);

        parentRepeater.DataSource = ds.Tables["clients"];
        Page.DataBind();

&nb

Dataset.tables.Select method

  

I want to select student who belogs to New York.so this purpose i write query as

ds.Tables("student").select("city==NewYork"); it is not work

where

"ds" is dataset

"city" is column name

"New York" is the string

Can anybody help me? 

Give me suggestion 


AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

Introducing ADO.NET and the Typed DataSet

  
In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

  
This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Get Top 1 Record from Dataset

  
Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.

Returning a DataSet From a Web Services: Step-by-Step

  
This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

Description

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

Select value in gridview

  

Hi, I am new to gridview. I want to make a gridview. Its row when selected should direct me to a specific .aspx page.Each row should direct to a different page. Should I use querystrings for this? Please suggest. Regards, ap.


Persist large dataset across ASP.NET pages. No database

  

Can anyone give me suggestions on how to implement the following requirement?

1. A online wizard (step-by step operation) processes user requests across several ASP.NET pages.  The session data is stored in memory until the user submits the request.  Once the request is submitted, a XML file is created and the data are passed to XML.

# Case Study: The parent page has a "select" button.  Click "select" will pop up a child page.  The users can select 1000+ items from a datagrid in the child page.  Once the user clicks "confirm", the selected items in the child page will be populated to the selected item gridveiw in the parent page.  The user can keep selecting more in the child page and the selected items will be appended to the gridview in the parent page.

Questions:

- What's the best way to extract strings from a text file and convert to a dataset in memory and then present it in a datagrid in UI?

- What's the best way to persist and manipulate a large dataset across pages?  Session? or ViewState? Can it be accomplished by LINQ?

The app doesn't interact with a DB.  Once the request is submitted, it will convert the in memory data to a XML file.  What technology can be used to accomplished this?&nb

Why not Dataset use to Saving?

  

Hie Friends,

I have searched on net and even i worked on 2 huge shipping projects.

Everywhere i found that while binding data to control use dataset but when we save, they recommend use command (use generic collection and create command object with store procedure) why not we use dataset as in .NET 2.0 it is improved lot and data adapter has new feature batchupdatesize.

why we need to create property page which maps to all column in a database.

E.g. if i have employee table with empid and empname in database then i use to create emp.cs with properties of empid and empname and use same properties for saving. If i use these properties for validation in business rule then no problem. But why we use them in saving for creating command object.

Thanks.



DAL Dataset showing all the column

  

I follow the tutorial and create DAL with Dataset. I created a Table Adapter with many column, but when i Call a simple Get for 2 column only. The system display 2 column and the rest column with empty data.

My question is that will this affect the performance? because i only need 2 column.

example: Table with 40 column define in Dataset in DAL. I have GetMember from Dataset with 40 column, some request only 1 column (with 39 empty), some request 22 column (with 18 empty column). Will this affact the performance?


Should i create a seperate DatasetAllColumn, Dataset1Column, Dataset22Column ?? so system only return exact column i need. and hofully the performance is optimized to it best.


merging multiple tables in a single dataset to single table

  

 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 


like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....



can some1 help me please.....


Export Dataset to excel sheet in a required format?

  

Hi,

I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend