Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am using a memory stream object and i want to use the create stream method to display a dataset in the browser window. I get the error:

 

"Cannot implicitly convert type 'System.IO.Stream' to 'System.IO.MemoryStream'"

 

on the line:

 

s = SF.CreateStream(GetData());

 

s is the memory stream object

 

SF is an object of the eXport.NET class (an add on that we use to export excel documents to browser - it supports the create stream method)

 

GetData() is the method that returns the dataset

 

private DataSet GetData()

{

SqlDataAdapter da;

DataSet ds;

ds = new DataSet();

da = new SqlDataAdapter("stpDEBgetInsuranceMailMerge", strConnection);

da.SelectCommand.CommandType = CommandType.StoredProcedure;

 

da.Fill(ds);

return(ds);

}

 

i would greatly appreciate any suggestions,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...