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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot read the next data row for the data set

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
Hi, My report runs fine when I view in VS, data shows fine when I run the query in the data window, but when I publish it to the server, I get the above error. I am running SQL server 2005 RTM and I have re-deployed the entire solution. Any ideas?

View Complete Post

More Related Resource Links

Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

Learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010 to read and write data to the AdventureWorks sample database.

Sample: Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

Explore the code in this visual how-to article as you learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010.

System.InvalidOperationException: Invalid attempt to read when no data is present.


Invalid attempt to read when no data is present.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Invalid attempt to read when no data is present.

Source Error: 

Line 53:             if (reader.HasRows)
Line 54:             {
Line 55:                 Response.Write(reader.GetString(0));

Here is my code:

System.IO.IOException: Unable to read data from the transport connection

Hello,   I have an xml webservice calling another xml web service and occasionally i get the following error - any ideas why?Does this happen when the request is made or when reading the response? Also how i can prevent it from happening? Thanks   System.IO.IOException: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. ---> System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)   --- End of inner exception stack trace ---   at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean readToUserBuffer)   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)   at System.Xml.XmlTextReaderImpl.ReadData()   at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, TextReader input)   at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)   at System.Xml.XmlTextReader..ctor(TextReader input)   at System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(SoapClientMessage message, I

Read data from BLOB field and write to sharepoint list

Hi, I want to read the data from BLOB field and write it into sharepoint list item. Please provide some pointer to archive above objective.   Thanks in Advance.

SslStream.Read() - Returns invalid data

Hey,I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express.I have successfully made the client application establish a connection, and send data, which appears in plain, de-crypted text on the server - this works.However, I am 'polling' the socket to see if data is available to read.Here is some code which is appropriate:----        public void Process(int threadId)        {            int BytesRead = 0;            try            {                Master.Log("BEGIN READ");                sslStream.ReadTimeout = 5000;                BytesRead = sslStream.Read(bytes, 0, bytes.Length);                Master.Log("READ " + BytesRead + " bytes");                if ( BytesRead > 0 )                {                   // process                }             } catch (IOException e) {                Log("Caught IOException: " + e.Message);                if (e.InnerException != null)                    Log("=========> INNER IOException: " + e.InnerException.Message);         }---- Here is some console output when running the application:---------LOG: Authentication successfulLOG: BEGIN READLOG: READ 140 bytesLOG: [Thread 0] [Client 1] [Address] Client.ProcessDataReceived()Text received from client: Testing

read data from excel

hi all,i had 2 columns in the excel file one is SNo and another Descriptionlooks like belowSno                         Description1                              1/2 Feet2                               1/5 Feet3                              204                               30i read the data from this file using below codestring strFileName = FileUpload1.PostedFile.FileName;            string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFileName + ";" + "Extended Properties=Excel 8.0;";            OleDbC

Not able to read Config File data in Windows Service

While I'm trying to read connection string which is in App.Config file I'm getting error like "Object reference not set to an instance of an object." string strconn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString(); For the windows service where I need to keep app.config file and how to integrate that config file with the windows service exe file. Thanks in advance.

how to read a custom dynamic data meta data attribute in a field template

All --Please help.I need to know how to read a custom dynamic data meta data attribute in a field template.I know how to do it in a page template because I have a handle to the meta table on the page.However, I do not know how to get a handle to the meta column at run time in a field template.Can you help?Please advise.Thank you.-- Mark Kamoski

Read Binary Data which is nothing but a Zip file and unzip through SSIS 2005 SP2

Hi ALL, I need some help in developing a task. I have a source database which is Oracle and it has a ZIP file stored inside the database in Binary format. When I move this data into the sql server 2005 database I get the data as binary data. Now the task begins with SSIS, I need to read the binary data which gives us a zip file and then unzip this zip file and read the XML data which is present inside the Zip file. I beleive some one might have already developed this task can you share the solution with us. Note: As this has to be moved into production I dont have permission to use third party tools like Cozy roc or install winrar.exe and simpy calling this exe from the execute process task in SSIS.  Raju

Rare exception: Unable to read data from the transport connection: An existing connection was forcib

Our .NET 2.0 app relies upon the ability to download xml webpages from URLs.  At startup, we have about 6 boxes in the wild (out of thousands) that are seeing the following inner exception when they try to download an xml page.  System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. (Inner: ) System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. They can get to the URL in their browser just fine, so we know our server is working.  Furthermore, the embedded WebBrowser control in our app can pull up webpages just fine, so I don't think their firewall is blocking our app.  I'm hoping it's just some diagnosible configuration issue.  Here is the snippet of code that does the downloading: WebRequest request = WebRequest.Create(fileToDownload.SourceUri);request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);request.Timeout = (int)DefaultTimeout.TotalMilliseconds;request.Method = "HEAD";WebResponse response = request.GetResponse(); Nothing revolutionary there. (I've also tried it without the HEAD request, without keepalive, and using HTTP 1.0).  And here is the exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. StackTrace Infor

How to read an Excel file and show data from 2 columns

Hi,I have an Excel file called Products.xls .I have Columns A and B, with the titles NAME and QUANTITY.The name of the sheet is SHEET1.The file has about 40 lines.How do i show these data on a Gridview or Listview ?Thank you.

Read from and write to Data Base an Image

Hi guys. How can I show a saved picturs from data base into a Image control? And how can I save an Image from my web page into data base? (with less code pleeeaaase.)

Read data from CD

Hello all, I'm wondering if it is possible to read data from a CD and load multiple files from it without actually having to browse for each one through an ASP page. I searched the web and all I can come with is to set however many number of file upload controls onto a page and upload each file individually whereas I am looking to search a directory and upload all files with a certain extension with only one file upload control. Actually if I knew the code behind then I could figure out how to get any interface problems solved. Thanks in advance.

data view web part - read and write using web service

Hi I am looking for an example on "Data View Web Part" in WSS 2010 to read and write data from a web service that I have written and then update the database. or if you have a any better way of doing this function of reading and writing data to and from "Data View Web Part" in WSS 2010. Thanks heapes in advance. Kind Regards,  sword

I need to read the data from one row and place this data into variables How would I do this?

Hi everyone,  I have not used a database in two years and then only for binnding to a datagrid view. I have made a compaq databse 3.5 and have built the columns. I know how to put the data in. I watched the Video on database and it showed how to bind controls to the datbase but it gave no method when you have the data in variables or when you need to get the data from the database and put them in a variable. I have also searched the forums but as of right now I have not found any example of reading a particular row and placing the data from certain columns into variables. I did find from different examples a way of updating the data base.  I am using the following code to update the database from variables.   http://forums.asp.net/t/1234353.aspx Dim dSet As DataSet Dim dRow As DataRow Dim dTable As DataTable Dim sqlCmd As SqlCeCommand Dim sqlConn As SqlCeConnection Dim sqlDapter As SqlCeDataAdapter sqlConn = New SqlCeConnection("Data Source=C:Database1.sdf") sqlDapter = New SqlCeDataAdapter sqlConn.Open() sqlCmd = New SqlCeCommand("SELECT * FROM MyTable", sqlConn) sqlDapter.SelectCommand = sqlCmd dSet = New DataSet sqlDapter.Fill(dSet, "MyTable") dTable = New DataTable dTable = dSet.Tables("MyTable") dRow = dTable.NewRow dRow(0) = 2 dTable.Rows.Add(dRow) ' sqlCmd = New

Why I won't be using Dynamic Data any more - please read this Microsoft!


Well, having spent a few weeks banging my head against a brick wall trying to learn Dynamic Data, I'm giving up. It looks like a great idea, but is fundamentally flawed in at least two respects...

1) The documentation and code samples are pitiful. As has been discussed several times before in this forum, it's almost impossible to learn the technology when the few resources that exist are woefully out of date, and hopelessly inadequate. Sure, you can get a basic DD site up and running quickly, but once you want to start cusotmising - which is essental if you're going to use this for real - you run into problems that just aren't covered anywhere.

I know someone is going to point me to the DD pages on MSDN, but to be blunt, they're no use for learnign anything more than the very basics. MSDN is a great reference resource, but that's only good when you know what you're looking for. It's no use for learning from the ground up. The videos on the www.asp.net site give you a start, but as soon as you want to do anything yourself, you run into problems that just aren't covered in the videos. Some things, like custom filters, just aren't mentioned at all, so how you're supposed to find out how to write your own is beyond me.

The only resource for help is this forum, but as there only seem to be two people here who act

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