<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Silverlight 2 (beta1) &#8211; Database Operations with ASP.NET Web Service in Silverlight 2</title>
	<atom:link href="http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2</link>
	<description>Sharing our knowledge</description>
	<lastBuildDate>Thu, 04 Mar 2010 13:05:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Siddharth Dahiya</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-3#comment-194411</link>
		<dc:creator>Siddharth Dahiya</dc:creator>
		<pubDate>Tue, 01 Sep 2009 20:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-194411</guid>
		<description>Hey Michael,

I need to retrieve data from my MSSQL server for a silverlight App. The problem is that if I do make a webservice and set it up, I will be putting it on the testing server ONLY. When the project is complete and the data is transfered to the deployment server, there is a posibility that the server IP/URL might change. therefore, can you make a suggestion as to how I should retrieve data from the SQL? the server is going to be static so I know the database will be where it is now.

Also, I also tried to make a blank aspx page that writes the required data to the response stream. But silverlight does not allow to download the contents of the web page.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>Hey Michael,</p>
<p>I need to retrieve data from my MSSQL server for a silverlight App. The problem is that if I do make a webservice and set it up, I will be putting it on the testing server ONLY. When the project is complete and the data is transfered to the deployment server, there is a posibility that the server IP/URL might change. therefore, can you make a suggestion as to how I should retrieve data from the SQL? the server is going to be static so I know the database will be where it is now.</p>
<p>Also, I also tried to make a blank aspx page that writes the required data to the response stream. But silverlight does not allow to download the contents of the web page.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Viral Patel</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-193882</link>
		<dc:creator>Viral Patel</dc:creator>
		<pubDate>Sat, 29 Aug 2009 06:46:12 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-193882</guid>
		<description>hi....

Can U provide how to insert ,update,Delete modify DAta in Database Table using SQL query and LinQ with ADO.NET dataservices.

thx in advance


Nice site....!! Have Nice Day..</description>
		<content:encoded><![CDATA[<p>hi&#8230;.</p>
<p>Can U provide how to insert ,update,Delete modify DAta in Database Table using SQL query and LinQ with ADO.NET dataservices.</p>
<p>thx in advance</p>
<p>Nice site&#8230;.!! Have Nice Day..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandra</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-179580</link>
		<dc:creator>Alexandra</dc:creator>
		<pubDate>Fri, 19 Jun 2009 23:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-179580</guid>
		<description>Hi Michael, 

First of all I want to say that I am kind of new in the programming world. I have a problem and maybe you can help me.
I made everything step by step, but I can&#039;t insert new information in table. I even get the message that the &quot;New Product has been saved successfully&quot; but nothing changes in the table.
I changed a little the web service for what I needed.
Is there something wrong with the code? Maybe the sintax, I don&#039;t really know because the program is error free.

 [WebMethod]
    public bool CreateProduct(string TextBox_Prenume, string TextBox_Nume, 
        int ComoBox_Zi, int ComoBox_Luna, int ComoBox_An, string Sexmf, 
        string TextBox_AdresaEmail, string parola)
    {
        try
        {
            SqlConnection _sqlConnection = new SqlConnection();
            _sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings[&quot;sqlConnectionString&quot;].ToString();
            _sqlConnection.Open();

            SqlCommand command = new SqlCommand();
            command.Connection = _sqlConnection;
            command.CommandType = CommandType.Text;
            command.CommandText = &quot;INSERT INTO Utilizatori(Prenume, Nume, Zi, Luna, An, Sex, AdresaEmail)VALUES(&#039;&quot; + TextBox_Prenume.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) + &quot;&#039;,&#039;&quot; + TextBox_Nume.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) +
&quot;&#039;,&#039;&quot; + ComoBox_Zi.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) +
&quot;&#039;,&#039;&quot; + ComoBox_Luna.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) + 
&quot;&#039;,&#039;&quot; + ComoBox_An.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) + 
&quot;&#039;,&#039;&quot; + Sexmf.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) + 
&quot;&#039;,&#039;&quot; + TextBox_AdresaEmail.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;)+
&quot;&#039;,&#039;&quot; + parola.ToString().Replace(&quot;&#039;&quot;, &quot;&#039;&#039;&quot;) + &quot;&#039;)&quot;;
            command.ExecuteNonQuery();
            _sqlConnection.Close();
            return true;

        }
        catch (Exception ex)
        {
            return false;
        }
    }

Thank you very much.</description>
		<content:encoded><![CDATA[<p>Hi Michael, </p>
<p>First of all I want to say that I am kind of new in the programming world. I have a problem and maybe you can help me.<br />
I made everything step by step, but I can&#8217;t insert new information in table. I even get the message that the &#8220;New Product has been saved successfully&#8221; but nothing changes in the table.<br />
I changed a little the web service for what I needed.<br />
Is there something wrong with the code? Maybe the sintax, I don&#8217;t really know because the program is error free.</p>
<p> [WebMethod]<br />
    public bool CreateProduct(string TextBox_Prenume, string TextBox_Nume,<br />
        int ComoBox_Zi, int ComoBox_Luna, int ComoBox_An, string Sexmf,<br />
        string TextBox_AdresaEmail, string parola)<br />
    {<br />
        try<br />
        {<br />
            SqlConnection _sqlConnection = new SqlConnection();<br />
            _sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["sqlConnectionString"].ToString();<br />
            _sqlConnection.Open();</p>
<p>            SqlCommand command = new SqlCommand();<br />
            command.Connection = _sqlConnection;<br />
            command.CommandType = CommandType.Text;<br />
            command.CommandText = &#8220;INSERT INTO Utilizatori(Prenume, Nume, Zi, Luna, An, Sex, AdresaEmail)VALUES(&#8216;&#8221; + TextBox_Prenume.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) + &#8220;&#8216;,&#8217;&#8221; + TextBox_Nume.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) +<br />
&#8220;&#8216;,&#8217;&#8221; + ComoBox_Zi.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) +<br />
&#8220;&#8216;,&#8217;&#8221; + ComoBox_Luna.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) +<br />
&#8220;&#8216;,&#8217;&#8221; + ComoBox_An.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) +<br />
&#8220;&#8216;,&#8217;&#8221; + Sexmf.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) +<br />
&#8220;&#8216;,&#8217;&#8221; + TextBox_AdresaEmail.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;)+<br />
&#8220;&#8216;,&#8217;&#8221; + parola.ToString().Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;&#8221;) + &#8220;&#8216;)&#8221;;<br />
            command.ExecuteNonQuery();<br />
            _sqlConnection.Close();<br />
            return true;</p>
<p>        }<br />
        catch (Exception ex)<br />
        {<br />
            return false;<br />
        }<br />
    }</p>
<p>Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2TIND Groep8: Silverlight</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-174839</link>
		<dc:creator>2TIND Groep8: Silverlight</dc:creator>
		<pubDate>Mon, 01 Jun 2009 12:09:06 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-174839</guid>
		<description>[...] http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in... [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in.." rel="nofollow">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in..</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rama</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-172006</link>
		<dc:creator>Rama</dc:creator>
		<pubDate>Wed, 20 May 2009 11:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-172006</guid>
		<description>Hi Michael,
           I just gone through your site and happy to say &quot;U r the man&quot; really helping us.

I have one query. My job is to get the Entity information from CRM and populate the date into Silver Light Webpage. For this I added the webservice and almost done everything. My problem is I am unable to retrieve the data and show it on Silver Light page. Can u just guide me step by step by code how to retieve the data through web service? Is it not possible to show the data into silver light directly without using any Input say &quot;btn click&quot;. Pls help me and thanks a ton in advance.</description>
		<content:encoded><![CDATA[<p>Hi Michael,<br />
           I just gone through your site and happy to say &#8220;U r the man&#8221; really helping us.</p>
<p>I have one query. My job is to get the Entity information from CRM and populate the date into Silver Light Webpage. For this I added the webservice and almost done everything. My problem is I am unable to retrieve the data and show it on Silver Light page. Can u just guide me step by step by code how to retieve the data through web service? Is it not possible to show the data into silver light directly without using any Input say &#8220;btn click&#8221;. Pls help me and thanks a ton in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian flowers</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-170996</link>
		<dc:creator>brian flowers</dc:creator>
		<pubDate>Wed, 13 May 2009 08:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-170996</guid>
		<description>Thanks for your excellent  tutorials on ado data services.  However, I having a problem with accessing stored procedures in our database, that returns data from a cross-join, with X number of columns.  Below is some sample code.  

When I go to show the data service in the browser, I get a Request Error - The server encountered an error processing the request. See server logs for more details.


What&#039;s a good approch for dealing with this type of dynamic data?

Thanks for you help,

Brian



Imports System.Data.Services
Imports System.Linq
Imports System.ServiceModel.Web
Imports System.Data.SqlClient
Imports System.Web
Imports System



Public Class PlayerDataServices

    Inherits DataService(Of [PlayerEntities])

    Public Shared Sub InitializeService(ByVal config As IDataServiceConfiguration)

        config.SetEntitySetAccessRule(&quot;Player&quot;, EntitySetRights.AllRead)
        config.SetServiceOperationAccessRule(&quot;*&quot;, ServiceOperationRights.All)
    End Sub


     _
    Public Function FetchPlayerStats(ByVal PlayerId As Integer, ByVal HeaderId As Integer, ByVal Year As Integer) As IEnumerable(Of DataRow)

        Dim ds As DataSet = New DataSet(&quot;PlayerStats&quot;)
        Dim da As SqlDataAdapter = New SqlDataAdapter()

        Try

            Using sqlConn As New SqlConnection(My.Settings.DBCn)
                Using sqlCmd As New SqlCommand(&quot;uspLIST_Stats&quot;, sqlConn)
                    sqlCmd.CommandType = CommandType.StoredProcedure
                    sqlCmd.Parameters.AddWithValue(&quot;id&quot;, PlayerId)
                    sqlCmd.Parameters.AddWithValue(&quot;HeaderID&quot;, HeaderId)
                    sqlCmd.Parameters.AddWithValue(&quot;Year&quot;, Year)
                    sqlConn.Open()

                    da.SelectCommand = sqlCmd
                    da.Fill(ds)
                End Using
                sqlConn.Close()
            End Using

        Catch ex As Exception
        End Try

        Return ds.Tables(0).AsEnumerable
    End Function
End Class</description>
		<content:encoded><![CDATA[<p>Thanks for your excellent  tutorials on ado data services.  However, I having a problem with accessing stored procedures in our database, that returns data from a cross-join, with X number of columns.  Below is some sample code.  </p>
<p>When I go to show the data service in the browser, I get a Request Error &#8211; The server encountered an error processing the request. See server logs for more details.</p>
<p>What&#8217;s a good approch for dealing with this type of dynamic data?</p>
<p>Thanks for you help,</p>
<p>Brian</p>
<p>Imports System.Data.Services<br />
Imports System.Linq<br />
Imports System.ServiceModel.Web<br />
Imports System.Data.SqlClient<br />
Imports System.Web<br />
Imports System</p>
<p>Public Class PlayerDataServices</p>
<p>    Inherits DataService(Of [PlayerEntities])</p>
<p>    Public Shared Sub InitializeService(ByVal config As IDataServiceConfiguration)</p>
<p>        config.SetEntitySetAccessRule(&#8220;Player&#8221;, EntitySetRights.AllRead)<br />
        config.SetServiceOperationAccessRule(&#8220;*&#8221;, ServiceOperationRights.All)<br />
    End Sub</p>
<p>     _<br />
    Public Function FetchPlayerStats(ByVal PlayerId As Integer, ByVal HeaderId As Integer, ByVal Year As Integer) As IEnumerable(Of DataRow)</p>
<p>        Dim ds As DataSet = New DataSet(&#8220;PlayerStats&#8221;)<br />
        Dim da As SqlDataAdapter = New SqlDataAdapter()</p>
<p>        Try</p>
<p>            Using sqlConn As New SqlConnection(My.Settings.DBCn)<br />
                Using sqlCmd As New SqlCommand(&#8220;uspLIST_Stats&#8221;, sqlConn)<br />
                    sqlCmd.CommandType = CommandType.StoredProcedure<br />
                    sqlCmd.Parameters.AddWithValue(&#8220;id&#8221;, PlayerId)<br />
                    sqlCmd.Parameters.AddWithValue(&#8220;HeaderID&#8221;, HeaderId)<br />
                    sqlCmd.Parameters.AddWithValue(&#8220;Year&#8221;, Year)<br />
                    sqlConn.Open()</p>
<p>                    da.SelectCommand = sqlCmd<br />
                    da.Fill(ds)<br />
                End Using<br />
                sqlConn.Close()<br />
            End Using</p>
<p>        Catch ex As Exception<br />
        End Try</p>
<p>        Return ds.Tables(0).AsEnumerable<br />
    End Function<br />
End Class</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iyer</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-170503</link>
		<dc:creator>Iyer</dc:creator>
		<pubDate>Sun, 10 May 2009 09:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-170503</guid>
		<description>Hi

Great, great article.  Followed it to the &quot;T&quot; and works beautifully.  Thanks a million for such a good tutorial.

Need a bit of help.  

This works perfectly on the local ASP.Net Development web server with port fixed to 5000 and a virtual directory configured.

When I publish this to a IIS 6.0 (Win2K3 Standard Server) system, no data comes into Silverlight - even though the Silverlight app loads fine.

From the server itself, I can access the operations of the webmethods, pass parameters and get them to return the data.

The webservice, obviously, has got published correctly.

Now what do I check?

Thanks a million, again - your article has helped me write my first Silverlight app - and I have a number of them in the pipeline :-)

Y</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Great, great article.  Followed it to the &#8220;T&#8221; and works beautifully.  Thanks a million for such a good tutorial.</p>
<p>Need a bit of help.  </p>
<p>This works perfectly on the local ASP.Net Development web server with port fixed to 5000 and a virtual directory configured.</p>
<p>When I publish this to a IIS 6.0 (Win2K3 Standard Server) system, no data comes into Silverlight &#8211; even though the Silverlight app loads fine.</p>
<p>From the server itself, I can access the operations of the webmethods, pass parameters and get them to return the data.</p>
<p>The webservice, obviously, has got published correctly.</p>
<p>Now what do I check?</p>
<p>Thanks a million, again &#8211; your article has helped me write my first Silverlight app &#8211; and I have a number of them in the pipeline :-)</p>
<p>Y</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: interperfect</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-162215</link>
		<dc:creator>interperfect</dc:creator>
		<pubDate>Thu, 09 Apr 2009 09:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-162215</guid>
		<description>@huzan

i have a problem same to u .
it pass a longtime while you write comment.

i want to know you have success this problem?

sorry for my bad english.</description>
		<content:encoded><![CDATA[<p>@huzan</p>
<p>i have a problem same to u .<br />
it pass a longtime while you write comment.</p>
<p>i want to know you have success this problem?</p>
<p>sorry for my bad english.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmie</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-143805</link>
		<dc:creator>Jimmie</dc:creator>
		<pubDate>Wed, 18 Feb 2009 04:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-143805</guid>
		<description>Hi Michael

I am sticking into one problem while consuming the database with listbox.
While the application loads on the server, Listbox is taking a very long time to display the dynamic content. Its really frustating me as i was unable to figure out the problem....
Please Help...Its very urgent...

Jimmie</description>
		<content:encoded><![CDATA[<p>Hi Michael</p>
<p>I am sticking into one problem while consuming the database with listbox.<br />
While the application loads on the server, Listbox is taking a very long time to display the dynamic content. Its really frustating me as i was unable to figure out the problem&#8230;.<br />
Please Help&#8230;Its very urgent&#8230;</p>
<p>Jimmie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: huzan</title>
		<link>http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2/comment-page-2#comment-131465</link>
		<dc:creator>huzan</dc:creator>
		<pubDate>Wed, 24 Dec 2008 07:41:39 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/10/silverlight-2-beta1-database-operations-with-aspnet-web-service-in-silverlight-2#comment-131465</guid>
		<description>I&#039;m getting the following error in ListingControl.xaml.cs:

The type or namespace name &#039;RetrieveProductsCompletedEventArgs&#039; does not exist in the namespace &#039;SL2WebSrv.WebServiceProxy&#039; (are you missing an assembly reference?)

at the following line:
void productMgrSoapClient_RetrieveProductsCompleted(object sender, SL2WebSrv.WebServiceProxy.RetrieveProductsCompletedEventArgs e)

what am i doing wrong?</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the following error in ListingControl.xaml.cs:</p>
<p>The type or namespace name &#8216;RetrieveProductsCompletedEventArgs&#8217; does not exist in the namespace &#8216;SL2WebSrv.WebServiceProxy&#8217; (are you missing an assembly reference?)</p>
<p>at the following line:<br />
void productMgrSoapClient_RetrieveProductsCompleted(object sender, SL2WebSrv.WebServiceProxy.RetrieveProductsCompletedEventArgs e)</p>
<p>what am i doing wrong?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
