Ask a Question related to ASP.NET Web Services, Design and Development.
-
Yan-Hong Huang[MSFT] #1
RE: Send a Dataset as a Dime Attachment
Hello,
Thanks very much for posting here.
After reviewing the question, I think you could just return dataset in the web method and then use it in your windows forms
client as the datasource. Dataset uses XML to store data internally and so it can be returned in webmethod in web service.
For an example:
[WebMethod]
public DataSet GetCustomers()
{
SqlConnection con = new SqlConnection("server=servername;uid=login;
pwd=password;database=northwind");
SqlDataAdapter daCust = new SqlDataAdapter("Select * From Customers", con);
DataSet ds = new DataSet();
daCust.Fill(ds, "Cust");
return ds;
}
For details, please refer to MSDN article "HOW TO: Update Server Data Through a Web Service by Using ADO.NET and
Visual C# .NET" at [url]http://support.microsoft.com/?id=310143[/url].
Thansk.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! - [url]www.microsoft.com/security[/url]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!Reply-To: "hs" <hs@nospam.syn>
!From: "hs" <hs@nospam.syn>
!Subject: Send a Dataset as a Dime Attachment
!Date: Fri, 1 Aug 2003 16:11:24 +0100
!Lines: 36
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
!NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservic es:18583
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
!
!Hi
!I looked in the archives and modified a webmethod example by Roman Kiss to
!give
!
![WebMethod]
!public string DownloadUsingDime()
!{
!
! // Create a new Dime Attachment class
! OleDbConnection dbconn = new OleDbConnection("Provider=MSDAORA.1;Data
!Source=Test");
! OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM Product",
!dbconn);
! DataSet ds = new DataSet();
! da.Fill(ds);
!
! MemoryStream ms = new MemoryStream();
! ds.WriteXml(ms);
!
! // attach body
! DimeAttachment attachment = new
!DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, ms);
! HttpSoapContext.ResponseContext.Attachments.Clear( );
! HttpSoapContext.ResponseContext.Attachments.Add(at tachment);
! return "Dime Test";
!}
!
!How can I send the dataset object as the dime attachment, as opposed to a
!Stream made up of the dataset's contents.
!
!My aim is to make the dataset object the datasource for a winform client
!datagrid.
!
!thanks
!
!
!
Yan-Hong Huang[MSFT] Guest
-
How to send a DIME attachment with SOAP
Hi! I am trying SOAP with DIME attachments in web services. The web service sends the file as attachment say "test.doc", and the client has to... -
Dime Attachment from client
Hi, Just install runtime WSE instead. -- ______________________________ With best wishes, Arthur Nesterovsky Please visit my home page:... -
DIME Attachment from Client to Server
hi, I need to write an application which needs to transfer a binary file from client to server. I will be able to send it as DIME attachment along... -
SoapExtensions, DIME Attachment and Pipes
Does anybody know a good C# replacement for java.io.PipedInputStream, PipedOutputStream? The reason I'm asking is sometimes I need transfer... -
Referenced DIME attachment
All, I am using .NET framework 1.WSE 1sp1. I am trying to send referenced DIME attachment (ie using href tag) from Apache Axis 1.1 client. I get... -
hs #2
Re: Send a Dataset as a Dime Attachment
Thanks YanHong.
I am actually carrying out some tests comparing a webmethod, like the one
you have shown and alternatively, sending a dataset as an attachement. Any
way I found the answer to my original question.
Datasets are serializable, so i just just serialize it before attaching it
to dime.
"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in message
news:NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl...web method and then use it in your windows forms> Hello,
>
> Thanks very much for posting here.
>
> After reviewing the question, I think you could just return dataset in theit can be returned in webmethod in web service.> client as the datasource. Dataset uses XML to store data internally and soSqlConnection("server=servername;uid=login;>
> For an example:
>
> [WebMethod]
> public DataSet GetCustomers()
> {
> SqlConnection con = newCustomers", con);> pwd=password;database=northwind");
> SqlDataAdapter daCust = new SqlDataAdapter("Select * FromThrough a Web Service by Using ADO.NET and> DataSet ds = new DataSet();
> daCust.Fill(ds, "Cust");
> return ds;
> }
>
>
> For details, please refer to MSDN article "HOW TO: Update Server Datarights.> Visual C# .NET" at [url]http://support.microsoft.com/?id=310143[/url].
>
> Thansk.
>
> Best regards,
> Yanhong Huang
> Microsoft Online Partner Support
>
> Get Secure! - [url]www.microsoft.com/security[/url]
> This posting is provided "AS IS" with no warranties, and confers nomicrosoft.public.dotnet.framework.aspnet.webservic es:18583>
> --------------------
> !Reply-To: "hs" <hs@nospam.syn>
> !From: "hs" <hs@nospam.syn>
> !Subject: Send a Dataset as a Dime Attachment
> !Date: Fri, 1 Aug 2003 16:11:24 +0100
> !Lines: 36
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Message-ID: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> !NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
> !Xref: cpmsftngxa06.phx.gblto> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> !
> !Hi
> !I looked in the archives and modified a webmethod example by Roman KissOleDbConnection("Provider=MSDAORA.1;Data> !give
> !
> ![WebMethod]
> !public string DownloadUsingDime()
> !{
> !
> ! // Create a new Dime Attachment class
> ! OleDbConnection dbconn = new> !Source=Test");
> ! OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM Product",
> !dbconn);
> ! DataSet ds = new DataSet();
> ! da.Fill(ds);
> !
> ! MemoryStream ms = new MemoryStream();
> ! ds.WriteXml(ms);
> !
> ! // attach body
> ! DimeAttachment attachment = new
> !DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, ms);
> ! HttpSoapContext.ResponseContext.Attachments.Clear( );
> ! HttpSoapContext.ResponseContext.Attachments.Add(at tachment);
> ! return "Dime Test";
> !}
> !
> !How can I send the dataset object as the dime attachment, as opposed to a
> !Stream made up of the dataset's contents.
> !
> !My aim is to make the dataset object the datasource for a winform client
> !datagrid.
> !
> !thanks
> !
> !
> !
>
>
hs Guest
-
Daniel Johansson #3
Re: Send a Dataset as a Dime Attachment
Hi
I have the same problem but I canīt access the
Microsoft.Web.Services.Dime - namespace.
How do I fetch that dll and what changes in .NET
do I have to do?
Regards
// Daniel
"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> skrev i meddelandet
news:NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl...web method and then use it in your windows forms> Hello,
>
> Thanks very much for posting here.
>
> After reviewing the question, I think you could just return dataset in theit can be returned in webmethod in web service.> client as the datasource. Dataset uses XML to store data internally and soSqlConnection("server=servername;uid=login;>
> For an example:
>
> [WebMethod]
> public DataSet GetCustomers()
> {
> SqlConnection con = newCustomers", con);> pwd=password;database=northwind");
> SqlDataAdapter daCust = new SqlDataAdapter("Select * FromThrough a Web Service by Using ADO.NET and> DataSet ds = new DataSet();
> daCust.Fill(ds, "Cust");
> return ds;
> }
>
>
> For details, please refer to MSDN article "HOW TO: Update Server Datarights.> Visual C# .NET" at [url]http://support.microsoft.com/?id=310143[/url].
>
> Thansk.
>
> Best regards,
> Yanhong Huang
> Microsoft Online Partner Support
>
> Get Secure! - [url]www.microsoft.com/security[/url]
> This posting is provided "AS IS" with no warranties, and confers nomicrosoft.public.dotnet.framework.aspnet.webservic es:18583>
> --------------------
> !Reply-To: "hs" <hs@nospam.syn>
> !From: "hs" <hs@nospam.syn>
> !Subject: Send a Dataset as a Dime Attachment
> !Date: Fri, 1 Aug 2003 16:11:24 +0100
> !Lines: 36
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Message-ID: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> !NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
> !Xref: cpmsftngxa06.phx.gblto> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> !
> !Hi
> !I looked in the archives and modified a webmethod example by Roman KissOleDbConnection("Provider=MSDAORA.1;Data> !give
> !
> ![WebMethod]
> !public string DownloadUsingDime()
> !{
> !
> ! // Create a new Dime Attachment class
> ! OleDbConnection dbconn = new> !Source=Test");
> ! OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM Product",
> !dbconn);
> ! DataSet ds = new DataSet();
> ! da.Fill(ds);
> !
> ! MemoryStream ms = new MemoryStream();
> ! ds.WriteXml(ms);
> !
> ! // attach body
> ! DimeAttachment attachment = new
> !DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, ms);
> ! HttpSoapContext.ResponseContext.Attachments.Clear( );
> ! HttpSoapContext.ResponseContext.Attachments.Add(at tachment);
> ! return "Dime Test";
> !}
> !
> !How can I send the dataset object as the dime attachment, as opposed to a
> !Stream made up of the dataset's contents.
> !
> !My aim is to make the dataset object the datasource for a winform client
> !datagrid.
> !
> !thanks
> !
> !
> !
>
>
Daniel Johansson Guest
-
Daniel Johansson #4
Re: Send a Dataset as a Dime Attachment
Thank you sir.
I have looked at "Using Web Services Enhancements to Send SOAP Messages with
Attachments"
and do think I will understand it. But Iīm trying to develop the web service
in C++ and am new to
that language. Can you help me with these code lines? I canīt get that part
working. Giving the fact that
attach is a new DimeAttachment
HttpSoapContext.ResponseContext.Attachments.Clear( );
HttpSoapContext.ResponseContext.Attachments.Add(at tach);
Regards
// Daniel
"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> skrev i meddelandet
news:qjn1aOTZDHA.2112@cpmsftngxa06.phx.gbl...server, there are a few additional DIME-> Hello Daniel,
>
> Even with WSE (Web Services Enhancements ) installed on the ASP.NET Weborder to use attachments with DIME. After> specific configurations that need to be made to the ASP.NET application in..NET, references to the> creating a new ASP.NET Web service project in Microsoft? Visual Studio?must also add a new type to the> Microsoft.Web.Services.dll assembly needs to be added to the project. Youfile for the project as follows:> soapExtensionTypes element by adding a new add element in the Web.configrights.>
> <configuration>
> <system.web>
> ...
> <webServices>
> <soapExtensionTypes>
> <add type=
> "Microsoft.Web.Services.WebServicesExtension,
> Microsoft.Web.Services,
> Version=1.0.0.0,
> Culture=neutral,
> PublicKeyToken=31bf3856ad364e35"
> priority="1" group="0" />
> </soapExtensionTypes>
> </webServices>
> </system.web>
> </configuration>
>
> For install WSE, you could search in Microsoft web site for it.
>
> Hope that helps.
>
> Best regards,
> Yanhong Huang
> Microsoft Online Partner Support
>
> Get Secure! - [url]www.microsoft.com/security[/url]
> This posting is provided "AS IS" with no warranties, and confers no<NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl>>
> --------------------
> !From: "Daniel Johansson" <adaoja-7@student.luth.se>
> !References: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>microsoft.public.dotnet.framework.aspnet.webservic es:18843> !Subject: Re: Send a Dataset as a Dime Attachment
> !Date: Sat, 16 Aug 2003 14:13:23 +0200
> !Lines: 112
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> !Message-ID: <uLQhT##YDHA.1900@TK2MSFTNGP10.phx.gbl>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> !NNTP-Posting-Host: cauchy.campus.luth.se 130.240.197.152
> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
> !Xref: cpmsftngxa06.phx.gblthe> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> !
> !Hi
> !
> !I have the same problem but I canīt access the
> ! Microsoft.Web.Services.Dime - namespace.
> !How do I fetch that dll and what changes in .NET
> !do I have to do?
> !
> !Regards
> !
> !// Daniel
> !"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> skrev i meddelandet
> !news:NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl...
> !> Hello,
> !>
> !> Thanks very much for posting here.
> !>
> !> After reviewing the question, I think you could just return dataset inso> !web method and then use it in your windows forms
> !> client as the datasource. Dataset uses XML to store data internally andKiss> !it can be returned in webmethod in web service.
> !>
> !> For an example:
> !>
> !> [WebMethod]
> !> public DataSet GetCustomers()
> !> {
> !> SqlConnection con = new
> !SqlConnection("server=servername;uid=login;
> !> pwd=password;database=northwind");
> !> SqlDataAdapter daCust = new SqlDataAdapter("Select * From
> !Customers", con);
> !> DataSet ds = new DataSet();
> !> daCust.Fill(ds, "Cust");
> !> return ds;
> !> }
> !>
> !>
> !> For details, please refer to MSDN article "HOW TO: Update Server Data
> !Through a Web Service by Using ADO.NET and
> !> Visual C# .NET" at [url]http://support.microsoft.com/?id=310143[/url].
> !>
> !> Thansk.
> !>
> !> Best regards,
> !> Yanhong Huang
> !> Microsoft Online Partner Support
> !>
> !> Get Secure! - [url]www.microsoft.com/security[/url]
> !> This posting is provided "AS IS" with no warranties, and confers no
> !rights.
> !>
> !> --------------------
> !> !Reply-To: "hs" <hs@nospam.syn>
> !> !From: "hs" <hs@nospam.syn>
> !> !Subject: Send a Dataset as a Dime Attachment
> !> !Date: Fri, 1 Aug 2003 16:11:24 +0100
> !> !Lines: 36
> !> !X-Priority: 3
> !> !X-MSMail-Priority: Normal
> !> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !> !Message-ID: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
> !> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> !> !NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> !> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
> !> !Xref: cpmsftngxa06.phx.gbl
> !microsoft.public.dotnet.framework.aspnet.webservi ces:18583
> !> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> !> !
> !> !Hi
> !> !I looked in the archives and modified a webmethod example by RomanProduct",> !to
> !> !give
> !> !
> !> ![WebMethod]
> !> !public string DownloadUsingDime()
> !> !{
> !> !
> !> ! // Create a new Dime Attachment class
> !> ! OleDbConnection dbconn = new
> !OleDbConnection("Provider=MSDAORA.1;Data
> !> !Source=Test");
> !> ! OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROMms);> !> !dbconn);
> !> ! DataSet ds = new DataSet();
> !> ! da.Fill(ds);
> !> !
> !> ! MemoryStream ms = new MemoryStream();
> !> ! ds.WriteXml(ms);
> !> !
> !> ! // attach body
> !> ! DimeAttachment attachment = new
> !> !DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType,to a> !> ! HttpSoapContext.ResponseContext.Attachments.Clear( );
> !> ! HttpSoapContext.ResponseContext.Attachments.Add(at tachment);
> !> ! return "Dime Test";
> !> !}
> !> !
> !> !How can I send the dataset object as the dime attachment, as opposedclient> !> !Stream made up of the dataset's contents.
> !> !
> !> !My aim is to make the dataset object the datasource for a winform> !> !datagrid.
> !> !
> !> !thanks
> !> !
> !> !
> !> !
> !>
> !>
> !
> !
> !
>
>
Daniel Johansson Guest
-
Daniel Johansson #5
Re: Send a Dataset as a Dime Attachment
Thank you sir
I will try to convert the code into C++ and reply with an answer.
Regards
// Daniel
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Daniel Johansson Guest
-
Yan-Hong Huang[MSFT] #6
Re: Send a Dataset as a Dime Attachment
Hello Daniel,
For C++ programming on it, you could refer to [url]http://msdn.microsoft.com/library/en-us/vcmex/html/vcconMCOverview.asp?[/url]
frame=true.
Sampel could be accssed at [url]http://msdn.microsoft.com/library/en-us/vcsample/html/vcoriInteroperabilitymcSamples.asp?[/url]
frame=true.
Hope that helps.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! - [url]www.microsoft.com/security[/url]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: "Daniel Johansson" <adaoja-7@student.luth.se>
!References: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl> <NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl>
<uLQhT##YDHA.1900@TK2MSFTNGP10.phx.gbl> <qjn1aOTZDHA.2112@cpmsftngxa06.phx.gbl>
!Subject: Re: Send a Dataset as a Dime Attachment
!Date: Mon, 18 Aug 2003 21:06:15 +0200
!Lines: 203
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
!Message-ID: <ukmUTubZDHA.1832@TK2MSFTNGP09.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
!NNTP-Posting-Host: cauchy.campus.luth.se 130.240.197.152
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservic es:18865
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
!
!Thank you sir.
!
!I have looked at "Using Web Services Enhancements to Send SOAP Messages with
!Attachments"
!and do think I will understand it. But Iīm trying to develop the web service
!in C++ and am new to
!that language. Can you help me with these code lines? I canīt get that part
!working. Giving the fact that
!attach is a new DimeAttachment
!
!HttpSoapContext.ResponseContext.Attachments.Clear ();
!HttpSoapContext.ResponseContext.Attachments.Add(a ttach);
!
!
!Regards
!// Daniel
!"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> skrev i meddelandet
!news:qjn1aOTZDHA.2112@cpmsftngxa06.phx.gbl...
!> Hello Daniel,
!>
!> Even with WSE (Web Services Enhancements ) installed on the ASP.NET Web
!server, there are a few additional DIME-
!> specific configurations that need to be made to the ASP.NET application in
!order to use attachments with DIME. After
!> creating a new ASP.NET Web service project in Microsoft? Visual Studio?
!.NET, references to the
!> Microsoft.Web.Services.dll assembly needs to be added to the project. You
!must also add a new type to the
!> soapExtensionTypes element by adding a new add element in the Web.config
!file for the project as follows:
!>
!> <configuration>
!> <system.web>
!> ...
!> <webServices>
!> <soapExtensionTypes>
!> <add type=
!> "Microsoft.Web.Services.WebServicesExtension,
!> Microsoft.Web.Services,
!> Version=1.0.0.0,
!> Culture=neutral,
!> PublicKeyToken=31bf3856ad364e35"
!> priority="1" group="0" />
!> </soapExtensionTypes>
!> </webServices>
!> </system.web>
!> </configuration>
!>
!> For install WSE, you could search in Microsoft web site for it.
!>
!> Hope that helps.
!>
!> Best regards,
!> Yanhong Huang
!> Microsoft Online Partner Support
!>
!> Get Secure! - [url]www.microsoft.com/security[/url]
!> This posting is provided "AS IS" with no warranties, and confers no
!rights.
!>
!> --------------------
!> !From: "Daniel Johansson" <adaoja-7@student.luth.se>
!> !References: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
!<NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl>
!> !Subject: Re: Send a Dataset as a Dime Attachment
!> !Date: Sat, 16 Aug 2003 14:13:23 +0200
!> !Lines: 112
!> !X-Priority: 3
!> !X-MSMail-Priority: Normal
!> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
!> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
!> !Message-ID: <uLQhT##YDHA.1900@TK2MSFTNGP10.phx.gbl>
!> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
!> !NNTP-Posting-Host: cauchy.campus.luth.se 130.240.197.152
!> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
!> !Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.framework.aspnet.webservi ces:18843
!> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
!> !
!> !Hi
!> !
!> !I have the same problem but I canīt access the
!> ! Microsoft.Web.Services.Dime - namespace.
!> !How do I fetch that dll and what changes in .NET
!> !do I have to do?
!> !
!> !Regards
!> !
!> !// Daniel
!> !"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> skrev i meddelandet
!> !news:NtWMVzvWDHA.1544@cpmsftngxa06.phx.gbl...
!> !> Hello,
!> !>
!> !> Thanks very much for posting here.
!> !>
!> !> After reviewing the question, I think you could just return dataset in
!the
!> !web method and then use it in your windows forms
!> !> client as the datasource. Dataset uses XML to store data internally and
!so
!> !it can be returned in webmethod in web service.
!> !>
!> !> For an example:
!> !>
!> !> [WebMethod]
!> !> public DataSet GetCustomers()
!> !> {
!> !> SqlConnection con = new
!> !SqlConnection("server=servername;uid=login;
!> !> pwd=password;database=northwind");
!> !> SqlDataAdapter daCust = new SqlDataAdapter("Select * From
!> !Customers", con);
!> !> DataSet ds = new DataSet();
!> !> daCust.Fill(ds, "Cust");
!> !> return ds;
!> !> }
!> !>
!> !>
!> !> For details, please refer to MSDN article "HOW TO: Update Server Data
!> !Through a Web Service by Using ADO.NET and
!> !> Visual C# .NET" at [url]http://support.microsoft.com/?id=310143[/url].
!> !>
!> !> Thansk.
!> !>
!> !> Best regards,
!> !> Yanhong Huang
!> !> Microsoft Online Partner Support
!> !>
!> !> Get Secure! - [url]www.microsoft.com/security[/url]
!> !> This posting is provided "AS IS" with no warranties, and confers no
!> !rights.
!> !>
!> !> --------------------
!> !> !Reply-To: "hs" <hs@nospam.syn>
!> !> !From: "hs" <hs@nospam.syn>
!> !> !Subject: Send a Dataset as a Dime Attachment
!> !> !Date: Fri, 1 Aug 2003 16:11:24 +0100
!> !> !Lines: 36
!> !> !X-Priority: 3
!> !> !X-MSMail-Priority: Normal
!> !> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!> !> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!> !> !Message-ID: <#QAkv8DWDHA.2360@TK2MSFTNGP12.phx.gbl>
!> !> !Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
!> !> !NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
!> !> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
!> !> !Xref: cpmsftngxa06.phx.gbl
!> !microsoft.public.dotnet.framework.aspnet.webservi ces:18583
!> !> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
!> !> !
!> !> !Hi
!> !> !I looked in the archives and modified a webmethod example by Roman
!Kiss
!> !to
!> !> !give
!> !> !
!> !> ![WebMethod]
!> !> !public string DownloadUsingDime()
!> !> !{
!> !> !
!> !> ! // Create a new Dime Attachment class
!> !> ! OleDbConnection dbconn = new
!> !OleDbConnection("Provider=MSDAORA.1;Data
!> !> !Source=Test");
!> !> ! OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM
!Product",
!> !> !dbconn);
!> !> ! DataSet ds = new DataSet();
!> !> ! da.Fill(ds);
!> !> !
!> !> ! MemoryStream ms = new MemoryStream();
!> !> ! ds.WriteXml(ms);
!> !> !
!> !> ! // attach body
!> !> ! DimeAttachment attachment = new
!> !> !DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType,
!ms);
!> !> ! HttpSoapContext.ResponseContext.Attachments.Clear( );
!> !> ! HttpSoapContext.ResponseContext.Attachments.Add(at tachment);
!> !> ! return "Dime Test";
!> !> !}
!> !> !
!> !> !How can I send the dataset object as the dime attachment, as opposed
!to a
!> !> !Stream made up of the dataset's contents.
!> !> !
!> !> !My aim is to make the dataset object the datasource for a winform
!client
!> !> !datagrid.
!> !> !
!> !> !thanks
!> !> !
!> !> !
!> !> !
!> !>
!> !>
!> !
!> !
!> !
!>
!>
!
!
!
Yan-Hong Huang[MSFT] Guest



Reply With Quote

