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

Top 5 Contributors of the Month
Post New Web Links

How to read a complete column from the dataset

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
I want to read complete column from the dataset using select command or whatever without looping the rows of the table.Because in table i got 35000 records i only want to read a one complete column from the top to the end using dataset.Eg: select column_name from table.lly, dataset.tables[0].select["Column='Product'"]I have tried with this but throwing exception.I was trying to get it but not able to find an answer.Please do the needful.Its very urgent.Suchitra.

View Complete Post

More Related Resource Links

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.

DataGridView>Edit Columns> Column Read Only property is unwilling to change

Hello, I am facing the following mystery: When changing the read only property of a column to false and reopening the "edit columns" window, it mysteriously turns back to true. Even when closing the designer and changing it in the designer code, the resulting execution does not allow edit, as well as when re-opening the designer you see true again.             this.numberDataGridViewTextBoxColumn1.DataPropertyName = "Number";             this.numberDataGridViewTextBoxColumn1.HeaderText = "Number";             this.numberDataGridViewTextBoxColumn1.Name = "numberDataGridViewTextBoxColumn1";             this.numberDataGridViewTextBoxColumn1.ReadOnly = true;//False is required We thought it might be related to data binding. rebinding the grid did not help as well. The is no other place in the code where it changes. Please advice, Thanks

SQLCE table column DefaultValues don't show up in XSD Dataset designer

Using Visual Studio 2008 with SQL CE 3.5, I notice that default values in the creation scripts for the database tables are not reflected in the dataset designer XSD file.  For example, the following SQL script creates the non-nullable table column names "Content" with a default value of 'Image':    "Content" nchar(20) NOT NULL DEFAULT 'Image',But in the column properties of the dataset designer (XSD) panel, this column correctly shows up as non-nullable, but with a DBnull default value as follows:     Name: Content    Allow DBnull: False    DefaultValue: <DBnull>Am I missing something somewhere, or is this a VS bug?  Also, how do I get the XSD file to regenerate after schema changes in the database?  Sqlmetal doesn't do it.Thanks,    -BGood

How to read a column of a sharepoint list to a text string field of infopath form?

My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

How to read xml into Dataset?

Hello,I have an xml result from this website:http://boss.yahooapis.com/ysearch/web/v1 asp.net ?appid=W1IezgnV34FUwlB1HUwJNSyQZPElPqUws18d7k8BTW0MuNzEx7x0DFRJjKO9ALKDibOmyTIYxZA-&format=xml&filter=-video&start=0&count=10And I want to load it directly into a dataset. I tried ds.Readxml(url) but it did not work. Thank you

Dataset column id get max value in the column

i have the following column "ID" in dataset: myDataSet.Tables("Table"), is it possible to read the columnd ID and get max id what is in the dataset. Thank you very much for the helpful info.

read excel column value

Hi All,             i am uploading excel file data to database.Excel column value is combination of text and time,i need to extract only time.Each column will have different value. One column value is   _immediate 17:00 - 9:00 another column value is EMAIL 09:30 - 18:00,another column value is CKA 09:30 - 18:30 ans so on. i need to extract only time and store it 2 different variables like this. string Intime - 17:00 string OutTime - 9:00   Please send me code to acheive this task.            

Not able to read all column in XML

Hi all, i have xml format as below.  but when i read through data set, some of the column, which ever specied as p2:type areare not binding with the grid, can any one suggest how to read those columns. i am reading xml as follows, XmlDocument dc = new XmlDocument(); DataSet ds = new DataSet(); StringReader strRdXml = new StringReader(dc.InnerXml); ds.ReadXml(strRdXml);     <element p2:type="MediaMarketResearch_PRODModel.GetSearchResultWithComplextype_Result" xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">   <StudyTypeID p2:type="Edm.Int32">102</StudyTypeID>   <StudyTypeName>TV Spot</StudyTypeName>   <LocalTitle>127 Hours</LocalTitle>   <LocalTitle_30>127 Hours</LocalTitle_30>   <TitleReleaseID p2:type="Edm.Int32">14818</TitleReleaseID>   <WideReleaseDate p2:type="Edm.DateTime">2010-11-05T00:00:00</WideReleaseDate>   <StudyDate p2:type="Edm.DateTime">2010-08-27T07:50:46</StudyDate>   <StudyDateFT>08/27/2010</StudyDateFT>   <StudyID p2:type="Edm.Int32">106086</StudyID>   <StudyNumber>us10083032</StudyNumber>   <StudyName>127 HOURS</StudyName>  

TCPClient and Read not returning complete data unless I use thread.sleep


Hello experts, here is my code that I have a question on:

 Dim receivedbyte(1024) As Byte
        Dim myread As Integer = 0
        Dim myresponsesb As New StringBuilder()
            myread = myns.Read(receivedbyte, 0, receivedbyte.Length)
            myresponsesb.Append(System.Text.Encoding.UTF8.GetString(receivedbyte, 0, myread))

        Loop While (myns.DataAvailable)

In the above, myns is a networkstream that is initialized with a tcpclient that is communicating with a XMPP server. basically, iam getting back xml messages.

The issue with the above is that if I dont use thread.sleep(500), the complete data is not returned. Why is that? I have tried to use a streamreader instead of read and using that method i can get complete data from the stream. What am I doing wrong with the Read method of networkstream?

SECOND: The XML being returned from the server is not well formed - the closing tag for one of the tags is missing and I am unable to use XDocument to parse this XML because of this. What could be the issue here? Is it my code or something on server end?

Also, what technique should i use to make the returned XML well formed so that I can use XDOCUMENT and LINQ to parse this?


How to read this .xml file to a dataset?



Having a hard time to get the .xls file data to a dataset:

Here is what I have done so far:

DataSet dst = new DataSet();
string sXPath = "response/result/Leads/row/FL";

XmlDocument doc = new XmlDocument();

XmlNode root = doc.DocumentElement; 

My .xml file example:

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/crm/private/xml/Leads/getRecords">
      <row no="1">
        <FL val="LEADID">258013000000072025</FL>
        <FL val="SMOWNERID">258013000000034003</FL>
        <FL val="Company"><![CDATA[abc]]></FL>
      <row no="2">
        <FL val="LEADID">258013000000072023</FL>
        <FL val="SMOWNERID">258013000000034003</FL>
        <FL val="Company"><![CDATA[xyz]]></FL>

Thanks a lot.

Read Only Managed Metadata column in DataSheet View


i am unable to edit managed metadata columns in the DataSheetView, i have other columns which are number, text field type which i am able to edit. So the view is not readonly, it is only when i click cell with the managed metadata column i get the readyonly prompt.

Evironment : Sharepoint 2010, Office 2007 and a pissed off customer

Appreciate any help

I am what i am

DataReader or DataSet to read an output parameter not essential?


I always thought we had to use a DataReader or a Dataset to read a given SQL data but i realized that it is not necessary to use them to read an SQL Output Parameter (im not a SQL expert).

AM i right???
Is it okay to do it that way?
Is it faster than using a DataReader?




Dim myConnectionDB As New SqlConnection(DbWrite)
Dim myCommand As SqlCommand = New SqlCommand("_AddUsers", myConnectionDB)

myCommand.CommandType = CommandType.StoredProcedure

myCommand.Parameters.Add(New SqlParameter("@UserId", SqlDbType.VarChar))
myCommand.Parameters("@UserId").Value = UserId

.... others parameters ...

myCommand.Parameters.Add(New SqlParameter("@RowCount", SqlDbType.Int))
myCommand.Parameters("@RowCount").Direction = ParameterDirection.Output

        Dim rowsaffected As Integer


on XML column


Hi all,

we have a XML column with an associated schema.

There are cases when opening the table we see "<Unable to read data>" in some rows. If we disable the schema and reopen the table, then we can see the XML values.

It's very strange, because if we paste the XML value in XMLSpy, we see it's well formed, and it acomplish the schema. And when the record is inserted, there's no message error, it looks the insertion is well-performed.



How to read value of Column under list using Sharepoint 2007



I am new to Sharepoint so please bear with me even if i ask for small clarifications.

I want to read the List using Powershell from Sharepoint Site.

Output i want to display is all columns that are under the Sharepoint List.


I have created a Sharepoint Web Application, Then i created the Sharepoint site Collection, then i created a new List named Employee List under Site Collection.

The Columns under that List are:

Empno,Empname and Salary.

I want to display the value of all the columns using the Powershell Script.

I am using the below Script.

 $list=$OpenWeb1.Lists["Employee List"]
 if($test -eq $null)
 Write-Host Site does not exist
 for($l=$listItemsTotal-1;$l -ge 0;$l--)
 Write-Host $listItems[$l].name

Change column names in report based on another dataset


My report displays a result set from DataSet1 which contains non-descriptive column names that are shown as my column headers.

A1, A2, A3, A4, ...

I have a second Dataset that contains 'friendly' names:

A1  Jan

A2   Feb

A3  Mar


How can I map the friendly names from DataSet2 to the column names that came with DataSet1?

Thank you for any help you may be able to provide.

Internal error. Buffer provided to read column value is too small. Run DBCC CHECKDB to check for any



I'm using Asp.NET 4 to perform a simple query on database.
But when navigating to page that needs data (i'm using SqlDataSource) i receive this internal error.
I already ran DBCC without error and i still have the issue.

Windows 2003 Standard with latest updates 32-bit
Sql Server Standard 2005 SP4

The same query, executed from SSMS works fine.

Il saggio è quello che sa di non sapere

Complete SQL Solution

SQL Server Solutions: SQL Server 2000/2005 Related Free Snippets.
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