Posts

Showing posts from June, 2008

SQL Server 2005 with XML Parameters

We frequently have requirement like Passing IDs in comma saperated value to the sql server for further processing. Generally what we do is just create loop and get the value from it and ... But SQL 2005 comes up with XQuery. Using this you can easly pass such type of data also some complex thing too. For example... DECLARE @productIds xml SET @productIds ='<Products><id>9</id><id>18</id><id>27</id></Products>' SELECT ParamValues.ID.value ('.','VARCHAR(20)')FROM @productIds.nodes('/Products/id')as ParamValues(ID) Which gives us the following three rows: 9 18 27

Page get postback twice in Mozilla!!!!

I face one problem in Mozilla but with other browser it works fine. The problem was like... the page get called twice!!! There is case when the server side code called twice, not lient side. After doing some good work found the solution, and was simpley good. The following line was causing the problem. <asp:image id="imgTest" runat="Server"/> In first look you can see there is no problem with it. But there is still problem; the missing ImageUrl. Mozilla send request to current page asking for an image, which we havent set yet; as the value get assign from server side, by this reason the only server side code is get executed twice!!!! Interesting, isn't it!! So here is the solution: <asp:image id="imgTest1" runat="Server" imageurl="abc.jpg"></asp:image>