Send a Dataset as a Dime Attachment

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. Dime Attachment from client
      Hi, Just install runtime WSE instead. -- ______________________________ With best wishes, Arthur Nesterovsky Please visit my home page:...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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...
    > 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
    > !
    > !
    > !
    >
    >

    hs Guest

  4. #3

    Default 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...
    > 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
    > !
    > !
    > !
    >
    >

    Daniel Johansson Guest

  5. #4

    Default 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...
    > 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.webservic es: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
    > !> !
    > !> !
    > !> !
    > !>
    > !>
    > !
    > !
    > !
    >
    >

    Daniel Johansson Guest

  6. #5

    Default 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

  7. #6

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139