Sunday, November 30, 2014

Delete node from treeview with the same attribute value

Get the node and check the value you need, you can reach the node like below:


https://chanmingman.wordpress.com/2012/02/21/how-to-update-xml-element/


then if that is what you want to delete use RemoveChild:


http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.removechild(v=vs.110).aspx


chanmm




chanmm


Delete node from treeview with the same attribute value

Am using



var doc = XDocument.Parse(openSourceFileDialog.FileName);

it possible ?


execute a stored procedure in a loop

Keep it simple and call the stored procedure for each string item in the list.


Passing an array to a store procedure isn't supported by SQL Server. The best you can do is create an XML string containing the array strings and let the stored procedure parse the XML. For most cases, this isn't worth it.


execute a stored procedure in a loop

Both alternatives are viable. Calling the SP from your code is trivial: Just write a loop that iterates through the List and invokes the procedure on each iteration. The (simplified) code would be similar to this:



SqlCommand cmd = new SqlCommand("myStoredProc", myConnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@myParameter", SqlDbType.NVarChar, 50);
myConnection.Open();
foreach (string s in myList)
{
cmd.Parameters[0].Value = s;
cmd.ExecuteNonQuery();
}
myConnection.Close();

The drawback to this approach is performance: If you have to pass lots and lots of strings, this will involve many invocations of the SP, which will be less than optimal.


There are many approaches to passing a list of values to an SP. You could encapsulate them in XML and use an XML parameter for the SP, which can then be parsed within the SP. Or you can pass a string that concatenates all the values with an interspersed separator such as a comma, and then process it with dynamic SQL. But, if you have SQL Server 2008 or above, the best way is to use a TABLE parameter. In your client code, insert the List items into a DataTable, and then pass the DataTable to the SP in its TABLE parameter. The SP can then process the table as a set, such as using an "insert into myTable select from theparameter", which would let you insert all of the rows without looping.


how to do complex validation on huge volume of records before inserting into table..please see the explained scenario and suggest ideas

You can use MERGE to implement your query for what your need.


Check some examples from MSDN:


http://msdn.microsoft.com/en-us/library/bb510625.aspx


how to do complex validation on huge volume of records before inserting into table..please see the explained scenario and suggest ideas

I think you can implement this using a stored procedure. you can capture full modifications done through grid and pass it using single database call on clicking the save. You can use table valued parameter to pass table of values or pass them as XML.


see


http://www.sommarskog.se/arrays-in-sql-2008.html




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


how to do complex validation on huge volume of records before inserting into table..please see the explained scenario and suggest ideas

Hey thanks for the answer! Was really looking for it. :)

how to do complex validation on huge volume of records before inserting into table..please see the explained scenario and suggest ideas

I am totally aware of this..but i want to how to build such logic in sql query...Please help...

2 Where Claues with 1 Sub query using NOT IN notation

This is not a classroom cheating forum.






Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







2 Where Claues with 1 Sub query using NOT IN notation

This is what i had before you posted:



Select CompanyName From Customers
Where Region NOT IN (Select Region From Employees
Where Country = 'USA' AND Country = NULL )
Order By CompanyName;



I can see where i went wrong with Where Clauses I had some of it correct when it came to the columns for each table. I see i should have had Country in the first where clause with the AND Logical Operator than Region field I had it backwards. I will make note of the IS NOT NULL and IS NULL in my book for future reference. I also noticed i did not have a Compound statement so i added that just in the wrong place.


Thank You for help.





2 Where Claues with 1 Sub query using NOT IN notation

Thank You for pointing that out i will work on remembering that in the future.

2 Where Claues with 1 Sub query using NOT IN notation

I have made note of your recommendation for the Not Exists i will try that out query out also and make a note of it in my book for an example to follow later down the road.


Thank You for the example.


how to do complex validation on huge volume of records before inserting into table..please see the explained scenario and suggest ideas

You can use MERGE to implement your query for what your need.


Check some examples from MSDN:


http://msdn.microsoft.com/en-us/library/bb510625.aspx


What is parameter passing in visual basic?

Can someone explain to me what parameter passing is in plain English?


Any help would be appreciated thanks!


What is parameter passing in visual basic?


Can someone explain to me what parameter passing is in plain English?


Any help would be appreciated thanks!



Sure - it's passing in parameters.


Next question?


;-)


...sorry, I couldn't resist. You're talking about calling a method (a sub or a function) and that method needs parameters - arguments - to know what to do.


Do you have something specific in mind? That would make things easier to explain.




Still lost in code, just at a little higher level.



:-)


2 Where Claues with 1 Sub query using NOT IN notation

How many more homework assignment do you expect us to do for you?


Don't you think it is time that you learn SQL programming and not cheat your professor?








Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







2 Where Claues with 1 Sub query using NOT IN notation


Select CompanyName From Customers
Where Country='usa'
and Region NOT IN (Select Region From Employees
Where Region IS NOT NULL )
Order By CompanyName;

--OR better to use not exists
Select CompanyName From Customers c
Where Country='usa'
AND Not Exists (select 1 From Employees e Where c.Region=e.Region)
Order By CompanyName;



how to show a datekey values greater than a particular datekey of a table in ssrs report

Hi,


I am doing the below but getting some weired result


=IIf(Sum(Fields!DateKey.Value, "DataSet2")> ReportItems!Textbox1.Value,Sum(Fields!DateKey.Value, "DataSet2"),Nothing)


textbox1 has the datekey ans datatset2 has all datekeys and then i am comparing




simanta


how to show a datekey values greater than a particular datekey of a table in ssrs report

Hi,


what I have done is now I have created a parameter and taking the values from one dataset and then passing this parameter to another dataset and tagging it into a textbox.


I am not getting any error but i am not getting the values


can anybody help




simanta


how to show a datekey values greater than a particular datekey of a table in ssrs report


Hi,


what I have done is now I have created a parameter and taking the values from one dataset and then passing this parameter to another dataset and tagging it into a textbox.


I am not getting any error but i am not getting the values


can anybody help




simanta



Can you show some sample values from dataset and then explain what output you want out of it?


Thats much than explaining as above




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


CAML query IN Clause limiation

Hi All,


I am trying to avoid joining the main document library list with another lookup custom list by first search the lookup custom list and get the document IDs to search them in the document library using IN clause.


The problem with the IN clause is that it does not support more than 500 items, after than an exception is report "unable to handle search query".


I am looking for the recommended solution for this problem.


B.S. I have read an incomplete post "https://social.msdn.microsoft.com/Forums/sharepoint/en-US/350b2e9e-0c50-4887-85d0-b7e8bce9a3b8/caml-query-in-clause-problem?forum=sharepointdevelopmentprevious" that suggests dividing the IN statements into bulks of 500 items, but this did not work with me either.


In my example:




<Where>
<In>
<FieldRef Name="ProgId" />
<Values>
<Value Type='Number'>6</Value>
-------------------more than 500 times.
<Value Type='Number'>10006</Value>
</Values>
</In>
</Where>



Thanks,





CAML query IN Clause limiation

Hi,


Please go through below link


http://sharepoint.stackexchange.com/questions/80210/caml-query-limitation-of-values-in-in-operator


Regards


Soni K


CAML query IN Clause limiation

Hi,


The CAML query string like this:



<or>
<or>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
</or>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
</or>

Best Regards




Dennis Guo

TechNet Community Support



CAML query IN Clause limiation

Thanks for your reply, I have a follow up question regarding the case in general. As I mentioned I am following this approach in order to enhance the performance by avoiding the join between two tables and replace it by two separate CAML query calls and, after what I've learned from your replies, I will also have to write my own function to prepare the second CAML query by dividing the IN list into chunks of 500s.


Is this still a recommended approach (also hoping that the CAML grammar can overcome this limitation), or is it recommended to keep the join in one CAML query and try to figure other ways to enhance its performance?


Generally speaking, if the parent table is 250K+ records and the child is 1-M with the parent, is two CAML calls using IN faster (or more recommended) than CAML query with join?


Thanks,





Fileupload attach documents

Hi all,


I needs to develop a visual webpart with file upload control and button.When user uploads some documents and the uploaded documents are saved in the same form with file name and date modified and when clicking on the file it needs to open.Please share me code sample.


Regards,


Praveen


Fileupload attach documents

Hi,


you can use the concept of document set for reference see below link


http://geekswithblogs.net/venkatx5/archive/2010/11/30/what-is-document-sets-in-sharepoint-2010.aspx


Here is a link how to create document sets programatically


https://code.msdn.microsoft.com/windowsapps/SharePoint-2010-Creating-41d2aa7a




Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer


Unknow error occured while Updating Mpp file to sharepoint 2010 list

Hi Abhishek, please share the answer, this will help this to forum


If my contribution helps you, please click Mark As Answer on that post and Vote as Helpful


Thanks, ShankarSingh(MCP)


How to explicitly convert an object to a System.Drawing.Bitmap

Try this:


Return CType(My.Resources.ResourceManager.GetObject("Lightoff"), Bitmap)


C# Sequential Searches

Greetings!


I am currently working on a program that allows the user to enter a name of a soldier and their dog tag number with objects and array. I have it all done but the problem comes with searching the content with either a string or an integer. Do I have to make 2 arrays? One for the names and another for the numbers? I want my program to display: Dog tag#12345 Private Oliver found at number 2.


Right now I have this in my main method:



int arraySize = 3;
int index = 0;
int soldierTag;
string soldierName;
string searchValue;

Soldier[] soldierArray = new Soldier[arraySize];

do
{
Console.Write("Please enter a 3 number dog tag: ");
soldierTag= int.Parse(Console.ReadLine());

if (soldierTag < 100)
{
Console.WriteLine(" Error");

}
else
{
Console.Write("Enter name of soldier: ");
soldierName = Console.ReadLine();

index++;
}
} while (index < arraySize);

Console.Write("Look for a soldier name or dog tag number: ");
searchValue = Console.ReadLine();

This is a portion of my class called Soldier with objects:





// I have another one like this for soldierTag



public string soldierName
{
get
{
return AsoldierName;
}
set
{
AsoldierName = value;
}
}

public Student(string soldierName, int soldierTag)
{
AsoldierName = soldierName;
AsoldierTag = soldierTag;
}

I can't seem to figure out how to search inside it. Do I need to add an if statement, a loop or maybe something else? I'm quite new and I have absolutely no idea.



C# Sequential Searches

Sequential search is just for loop and if statement.


Check this.


http://www.rkinteractive.com/blogs/SoftwareDevelopment/post/2011/07/06/Algorithms-In-C-Sequential-Search.aspx


chanmm




chanmm


execute a stored procedure in a loop

Hi Professionals


Here's my case. I am using C#, and I have a List<string> as a result of certain calculation. What is required that I need to insert each item of the list into the database. This is done through a stored procedure, which perform some business logic on an item, then inserts it into a table. What is the best scenario to iterate through my list items? is it feasible to pass item by item to the stored procedure, which means that I will handle the loop in my C# program? or pass the entire list to the procedure and modify it to handle the loop in t-sql ??


I appreciate your assistance.


Regards


Get secondary tile id windows phone 8.1

Hello,


What would be the easiest way of getting the ID of the secondary tile that was used to launch the app.


Nathan


power button not working; is it my app?

since I installed my app on my phone the power button does not work anymore. I have to do a soft reboot to restore button. Am I doing something wrong in my app? (in the app.xaml.cs I just have code to handle suspend; do I need any thing else?)


Thank you


Pierre


how to show a datekey values greater than a particular datekey of a table in ssrs report

Hi,


I am showing a datekey in a textbox in ssrs report.


Now for example see below


say my table has datekey as 20141109,20141108,20141107 and 21041106


in one textbox I am showing 20141106


how to show all other datekeys above 20141106 in another textbox


I wanted to show like in first textbox it should be like 11/06 and in the below textbox it should be 11/7,11/08,11/09




simanta


how to show a datekey values greater than a particular datekey of a table in ssrs report

Hi fanu987,


According to your description, you want to change the text into date format. Right?


In Reporting Services, we can use expression to format the text into a date first. Pleaes use the expression below:


=CDate(Left(Fields!DateKey.Value,4)+"/"+Left(Right(Fields!DateKey.Value,4),2)+"/"+Right(Fields!DateKey.Value,2))


Then we can apply a filter on a table to display all "date" which is later than 2014/11/06. We just need to use the above expression in filter.


For only showing the "11/06" in textbox. We can use the expression below:


=Left(Right(Fields!DateKey.Value,4),2)+"/"+Right(Fields!DateKey.Value,2)


Reference:

Expression Examples (Report Builder and SSRS)


If you have any question, please feel free to ask.


Best Regards,

Simon Hou


how to show a datekey values greater than a particular datekey of a table in ssrs report

If both textboxes are in same conatainer within same scope you can use an expression like this for the seconf textbox



=IIf(Fields!DateKey.Value > ReportItems!FirstTextboxName.Value,Fields!DateKey.Value,Nothing)





Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


interpolation of Dots in Graph

hello



as you can seen in the sample graph i made all graph except it's curve line.


all the "Empty Circle" and "Filled Circle" have their X,Y coordination but the curve is drawn in an optimum path.


how can i find optimum path foe drawing such curve.


thanks


Web browser control Download file from A dynamic Url

If you can determine the address (URL) that returns the file, then you can download the file directly using WebClient.DownloadFile or WebClient.DownloadFileAsync.


SQL query

First of all, the root problem here is the database design. This column should have been several columns from the start. Or at least XML...


Next thing to observe is that as you trawl through the data, you will undoubtedly find rows where the format deviates. Maybe fields are in different order. Maybe colons are missing. Or maybe the space after the colon is missing. Or even worse, there are colons in the values, and in fact this is the case in your sample (the URL).


Kalman suggested to use a split function with ': ' as the separator, but that would give you values like Address, Newway 5 Zip Code, 52880 Place, so this is a non-started.


As Uri hints the code to crack this in T-SQL would be ugly, even we naïvely assume that this sample reflects all complications we can encounter.


No, there are better languages than T-SQL to deal with this mess. Assuming that it is not in your powers to change the table definition (but you could still raise the point to the power that be), your best bet might be to parse the columns client-side, if that fits with your application. Or write a CLR procedure in C# (or VB .NET) cracking the field into columns, using RegEx class and all the other powers of string manipulation in .NET which exceeds what T-SQL offers.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

XML query dataset and to fill a datatable with this dataset

I run this code but I have error on ds.Tables[0].Rows[1][1].ToString()). why?


I can see data in datagridview1.



string myXMLfile = Application.StartupPath + @"\Query4.xml";
DataSet ds = new DataSet();
ds.ReadXml(myXMLfile);
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Query4";
MessageBox.Show(ds.Tables[0].Rows[1][1].ToString());






Share on facebook user wall, get all fan pages the logged in user admin of and share on those pages as well.

Hi all


I have requirement while working on sample project.


Share on Facebook user wall.


Getting all the fan pages that user has admin of


Share on those fan pages as well.


Can anybody help me please; It's an urgent.


Any help or suggestion would be greately appreciated.


Thanks


SuneelKumar Biyyapu.


Saturday, November 29, 2014

How do you use 3 Where Clauses in a query

Thank you for the help i am not looking for people to do all of it just some guidance on what i am doing wrong and why i am doing it wrong; I want to learn how to do this properly.


Again Thank You for your help.



How do you use 3 Where Clauses in a query

Thanks for info


Regards,


Enis,


Splitting report into pages

Hello, I am pretty much new to SSRS, and until now my knowledge was enough to make request to DB and print it as a report in table.


However one of the client is having report that is containing a lot of columns. F.ex. Each report has collumn with Year, Month, Day, Hour + 20-30 collumns that shows the avg values of some data from DB. While they are printing it it is splited automaticly (something like with printing excel sheets) and it look bad.


What i would like to recive is report that splits itself into multiple pages, each of them should contain collumns with dateparts and next to them as many collumns as it's possible to fit into A4 page of print. It can't be done with some statics setups as user is able to hide any collum he likes.


Can you provide me something ?


Fileupload attach documents

Hi all,


I needs to develop a visual webpart with file upload control and button.When user uploads some documents and the uploaded documents are saved in the same form with file name and date modified and when clicking on the file it needs to open.Please share me code sample.


Regards,


Praveen


Fileupload attach documents

Hi,


you can use the concept of document set for reference see below link


http://geekswithblogs.net/venkatx5/archive/2010/11/30/what-is-document-sets-in-sharepoint-2010.aspx


Here is a link how to create document sets programatically


https://code.msdn.microsoft.com/windowsapps/SharePoint-2010-Creating-41d2aa7a




Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer


C# scheduled task app runs slower than with Visual Studio

Hello,


A C# database app will actually time out when run from a scheduled task.


The app runs fine from Visual Studio.


Any suggestions?


I am using Windows 7 Ultimate with 24 GBs of ram.


williamj




williamj


Cannot convert a char value to money (Subquery)


SELECT ProductName, UnitPrice
FROM Products
WHERE UnitPrice>
(SELECT UnitPrice
FROM Products
WHERE ProductName= 'Tarte au sucre')
Order By UnitPrice DESC;


Cannot convert a char value to money (Subquery)

Thank You very much for the help it is appreciated.

Inserting animated images in our app

I want to insert animated images in my app. what should i use? And when i try to insert PNG images, they also come blank, except for the ones already in the template.

Inserting animated images in our app

1. add a Image element in xaml code, lke:



<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Image Height="100" Width="100"/>
</Grid>

2. put your mouse curosr on this Image element



3. open the properties panel , find "Common" --> "Source"





4. about animation see :

[Windows 8.1 Development Series] 6 - Windows 8.1 Blend for VS2013 & Animations
Blend for visual studio and animation in application windows 8
Getting Started: Animation




在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。


Fileupload attach documents

Hi all,


I needs to develop a visual webpart with file upload control and button.When user uploads some documents and the uploaded documents are saved in the same form with file name and date modified and when clicking on the file it needs to open.Please share me code sample.


Regards,


Praveen


Deploying third party dll from solution

Thank u so much...


it worked...


c# live sdk calendar Sign In without SignInButton

hi to all,


can i read, insert updates calendars events in outlook.com through live sdk without SignInButton?


Where can i found an example?


Thanks in advance


Problems enabling xp_cmdshell

Secondary tile pinning and sound playing

Hi everyone,


What would be the easiest way to play a sound clip when a tile is clicked? The tiles don't need to update or anything the just need to display the name of the sound to be played.


Any help would be appreciated


Nathan


Problems enabling xp_cmdshell

Overlapping Bubble Charts with Categories

I am struggling to create a report that looks like this in SSRS 2008 R2:


Where I have a list of emails like this:


I'm struggling to create an SSRS report with this data and a chart that looks like the attached:


Email, ContactType


aaaa@bb.com, "Account Manager"


ccc@company.com, "Account Manager"


aaa@bb.com, "Legal"


Basically there is an overlap, the chart is a bubble chart that is a count of email types, and the overlapping area is where the contacts are the same email address.


Is this even possible in SSRS?





Scott Weeden


how to setup backgroud imagge based on the expression

Embedded image with in the report



Thanks & Regards Manoj


Validate Order

Hi folks, looking for some help, my store proc saves customer order details to ms sql database and is fired by the user clicking on a command button.


I need the stored proc to validate if the OrderID already exists within the database before saving the order, not really sure how to do this. Code below,



USE [TyreSanner]
GO
/****** Object: StoredProcedure [dbo].[AddCustomerDetails] Script Date: 11/27/2014 22:32:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddCustomerDetails]

/***********************Declare variables ***********************/

/******tblCustomer******/
@Forename nvarchar(50),
@Surname nvarchar(50),
@HouseNo nvarchar(50),
@CustAddress nvarchar(50),
@Town nvarchar(50),
@Postcode nvarchar(50),
@ContactNo nvarchar(50),
@EmailAddress nvarchar(50),

/******tblLink_OrderProduct******/
@ProductQuantity int,
@TotalProductSaleCost decimal,
@ProductFK int,
@FittingDate date,
@FittingTime Time
As
DECLARE @CustomerFK int;
DECLARE @OrderFK int;
Begin TRANSACTION
SET NOCOUNT ON

INSERT INTO [TyreSanner].[dbo].[Customer](Forename, Surname, HouseNo, CustAddress, Town, Postcode, ContactNo, EmailAddress)
VALUES (@Forename,@Surname,@HouseNo,@CustAddress,@Town,@Postcode,@ContactNo,@EmailAddress)


Set @CustomerFK = SCOPE_IDENTITY()

INSERT INTO [TyreSanner].[dbo].[Order] (CustomerFK)
VALUES (@CustomerFK)


SET @OrderFK = SCOPE_IDENTITY()

INSERT INTO [TyreSanner].[dbo].[Link_OrderProduct](OrderFK, ProductFK, ProductQuantity, TotalProductSaleCost, FittingDate, FittingTime)

VALUES
(@OrderFK, @ProductFK, @ProductQuantity, @TotalProductSaleCost, @FittingDate, @FittingTime)

SELECT SCOPE_IDENTITY() AS Link_Id;



COMMIT TRANSACTION


Validate Order

First of all, don't put the name of the database in the stored procedure. Sooner or later you will want a test environment on the same instance you are on.


Next, the procedure seems somewhat strange. What if the customer already exists? Or do I get a new CustomerFK each time I place a new order?


You need to validate the OrderID, but I don't see any order ID as input?


For the table Link_OrderProduct you seem to have an IDENTITY column. I think the key on this table should be (OrderFK, ProductFK). Or can the same product appear twice on an order?





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Validate Order

Hi Erland,


yes everytime the customer places a new order, they will recieve a new CustomerFK within the Order table, the Link_OrderProduct table has the following keys;



  • LinkID

  • Order foreign key

  • Product foreign key


as products can appear twice on an order, can I not validate on the


Order foreign key within the Link_OrderProduct table?


Validate Order

as per what you explained you just need a EXISTS condition chek with Order table to make sure OrderID value is not existing already


Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Validate Order

Hi Visakh, could you please give me an example, ta.

Validate Order


INSERT INTO [TyreSanner].[dbo].[Link_OrderProduct](OrderFK, ProductFK, ProductQuantity, TotalProductSaleCost, FittingDate, FittingTime)
SELECT @OrderFK, @ProductFK, @ProductQuantity, @TotalProductSaleCost, @FittingDate, @FittingTime
WHERE EXISTS (SELECT 1
FROM OrderTable
WHERE OrderID = @OrderFK)





Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Validate Order

If you have a primary key constraint on the OrderID column, there cannot be any duplicates. Would for some reason the IDENTITY generation be reset and start to generate duplicates (and this can happen), you will get an error when you insert.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Update Statistics

So what is your question/query buddy




Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it



My Technet Wiki Article


MVP


Update Statistics

Just shared Info :) this might help some one who is in need. :)


Regards, Pradyothana DP http://ift.tt/1sEFSlq .Please Mark This As Answer if it solved your issue.


Inserting animated images in our app

I want to insert animated images in my app. what should i use? And when i try to insert PNG images, they also come blank, except for the ones already in the template.

XML query dataset and to fill a datatable with this dataset

Hello


I convert ACCESS DB into XML.


I wrote this code:




string myXMLfile = Application.StartupPath + @"\Query_Table_Search.xml";
DataSet ds = new DataSet();
DataTable dt=new DataTable();
ds.ReadXml(myXMLfile);
dt= ds.Tables[0];

I get error: "Cannot find column 2" for dt.Rows[i][2].ToString() . I have just 1 row as a result and that is date of system. why?


This query has just one table.











XML query dataset and to fill a datatable with this dataset

You might need to define the columns. See this:


http://msdn.microsoft.com/en-us/library/fx29c3yd(v=vs.110).aspx


chanmm




chanmm


XML query dataset and to fill a datatable with this dataset

Hello


Thank you


I looked at the ds but there is not any tables and count=0. all things are null or 0.


dt is null.


Like in Dataset Parameter

Hi guys, I want to do a search having "Like" so they can search even the first letter of what they want, I'm using a Report Viewer and I have a data set and added the table, I added a parameter from the properties and have made a report using the report viewer. here's the code.



this.ScheduleTableAdapter.Fill(this.DataSet1.Schedule, tbSearch.Text);
this.reportViewer1.RefreshReport();

tbSearch is the textbox where they input the data they want to search.


TIA.


Help on performance with dynamic query

First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.


There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.


We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable. It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.


You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Help on performance with dynamic query

Optimization: http://www.sqlusa.com/articles/query-optimization/


In a stored procedure each statement must be optimized and excessive looping avoided.








Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







Update Statistics

So what is your question/query buddy




Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it



My Technet Wiki Article


MVP


Bitmap (Stream stream)

Your stream is already in use.


If you put a variable like a stream inside a foreach loop then that is a new variable each time it iterates.


I would consider something more like:



private List<string> FileList = new List<string>();
private void LoopFiles()
{
foreach(string path in FileList)
{
Image img = LoadImage(path);
System.Console.WriteLine(img.Width + " " + img.Height);
}
}

private Image LoadImage(string path)
{
var ms = new MemoryStream(File.ReadAllBytes(path));
return Image.FromStream(ms);
}

Obviously, you need to fill FileList with a list of file paths.





Hope that helps

Please don't forget to upvote posts which you like and mark those which answer your question.


how to setup backgroud imagge based on the expression

Is image embedded within report or is it deployed to server?


Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Help on performance with dynamic query

You need to analyze the execution plan for that and see costly steps


With your explanation alone its not enough for us to suggest much on performance.




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Help on performance with dynamic query

First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.


There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.


We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable. It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.


You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Contour plot to make light effect?

Is it possible to contour a shape while reducing alpha to get light effect?


Extract images and Text from MHT files

If I were you then I will think of filing a sdk to print from mht to whatever format that you are comfortable to open like Word or Pdf. Then I read the content from those formats.


chanmm




chanmm


Help on performance with dynamic query

You need to analyze the execution plan for that and see costly steps


With your explanation alone its not enough for us to suggest much on performance.




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Windows 8 Save CANVAS as IMAGE WinRT Metro App C#

Hi


You can use following snipped to save Canvas or other Ui element as image



RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();

await renderTargetBitmap.RenderAsync(ImageCanvas);//put the name of Canvas or Image contanier to be saved
var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();


var savePicker = new FileSavePicker();
savePicker.DefaultFileExtension = ".png";
savePicker.FileTypeChoices.Add(".png", new List<string> { ".png" });
savePicker.FileTypeChoices.Add(".jpg", new List<string> { ".jpg" });
savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
savePicker.SuggestedFileName = "photo.png";



var saveFile = await savePicker.PickSaveFileAsync();

if (saveFile == null)

return;

using (var fileStream = await saveFile.OpenAsync(FileAccessMode.ReadWrite))
{
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, fileStream);

encoder.SetPixelData(
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Ignore,
(uint)renderTargetBitmap.PixelWidth,
(uint)renderTargetBitmap.PixelHeight,

DisplayInformation.GetForCurrentView().LogicalDpi,
DisplayInformation.GetForCurrentView().LogicalDpi,
pixelBuffer.ToArray());

await encoder.FlushAsync();
}


Mark this answer if you find this helpful


Creating a Month dropdown list for a report with multiple datasets

I am currently working on a report that contains many charts that rely on multiple datasets. Currently, I have parameters @StartDate and @EndDate to display the information of the previous month across all the charts as my default value. Now, I would like to create a dropdown list so that the user can pick any month, and have the report display the data across all the charts for that particular month, while keeping the display of the previous month as the default value. Can anyone help as to how I can approach this. Would I have to use an expression when I specify my available values, or would I have to create a dataset to get the value of all 12 months? Any help would be greatly appreciated.

Creating a Month dropdown list for a report with multiple datasets

Just add a parameter for month. use a dataset that returns individual moths of year and link it to parameter to populate the values. Then in query behind use a logic to do filtering based on previous month


it will look like this



DECLARE @Month int = 5 --example value

SELECT ...
FROM Table
WHERE datefield >= DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-2),0)
AND datefield < DATEADD(mm,DATEDIFF(yy,0,GETDATE())*12 +(@Month-1),0)



The value you will pass from SSRS to query from parameter




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Sorry, something went wrong error when adding a calculated column

Hi


What do you mean with [10]+[10]?




Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.


Sorry, something went wrong error when adding a calculated column

Hi Romeo,


this was a test, so if the user selects ISDN in the drop down box. The DB Loss column would generate a total of 20... since the calculation is 10+10


Sorry, something went wrong error when adding a calculated column

Anyone else have an idea?

Page Deadlock

You may please provide more info:


1. Table column details


2. Index details


3. Execution Plan for the query


How did you find its page lock? Please share your deadlock graph possibly.


Page Deadlock

Friday, November 28, 2014

Issues with calling COM Component API's within Impersonation

Hi Kristin,


What I have done is:


1)Created one user "test1", add it into power users.


2)Created one folder and give access to that folder to only "test1" user


3)Login using "test1" and added some file to which read by COM component and logout


4)Login using regular user, create c# application which do impersonation using "test1" credentials and try to read that folders file using COM component.


If I add "test1" to admin users then it success but when I add to it into power users then it throws exception "Access denied".


lf you have any suggestions please let me know.


Best Regards,


Bharat




Bharat Bodage


Issues with calling COM Component API's within Impersonation

Now the issue is not C# code issue. I think you'd better ask in technet forum.

Issues with calling COM Component API's within Impersonation

Since win 7, power users have no more rights than regular users.


This could be your problem.




Hope that helps

Please don't forget to upvote posts which you like and mark those which answer your question.


uniqueidentifier and stored procedures

insert that unique identifier column using newid()


like


insert into tbl (uniqueidentifiercolumn) values(newid())




ADKR


How can i get end balance

You can use integer value while using between operator.



AND balance BETWEEN 10 AND 100



You can typecast to integer and use in between operator. To deduce exact answer can you post actual dataset you are using.




Tech


How can i get end balance

Your question is not clear...


Are you looking for the below? If not, please provide sample data and your desired output....



SELECT tday,SUM(balance) AS 'Total Balance'
FROM savta
WHERE prodid = 'S004'
--AND tday ='2014-09-01'
AND balance BETWEEN '10' AND '100'
Group by tday


How can i get end balance

whats the datatype of tday?

How can i get end balance

The dataype of tday is: date/time

How can i get end balance

You can use between in dates also, this will give you data between those dates + balance range of 10 to 100.



SELECT SUM(balance) AS 'No of Deposit'
FROM savta
WHERE prodid = 'S004'
AND tday between '2014-10-01' and '30-09-2014'
AND balance BETWEEN 10 AND 100





Tech


Two apps, same functionality but different branding? (Product Flavors?)

I would like to release two versions of my application. The implementation is basically the same but with a different branding.


So there may be different texts, images, resources, API endpoints. Also it should have its own Package.appxmanifest and Package.StoreAssociation.xml since these are going to be different for two different store builds.


In the end I'm looking for something like "Product Flavors" on Android.


Android Product Flavors


"A product flavor defines a customized version of the application build by the project. A single project can have different flavors which change the generated application."


It offers the functionality to overwrite basically everything you want to for each different product flavor.


Is there a way to create something like different build targets to overwrite any files I want to?



I think creating different projects won't be an options since the project is a Universal Project which already has 2 projects with a shared library. I would need to create 2 sub-projects for each of them to achieve such functionality?!



Two apps, same functionality but different branding? (Product Flavors?)

There isn't anything like Product Flavours, but here's how I do it:


Put all your code in one (or more) project, and have separate solutions for your different app versions. These solutions can just contain the images, package info, resources, etc. for that 'brand', and the code will come from simply importing the project you keep all your code in.


Being a Universal App shouldn't make a difference - just have a separate Universal solution for each brand, and reference the shared code project as usual.


You could possibly have one solution including multiple brand projects (containing only data/images/etc. for that brand), then only enable the project for the brand you want to build the app for.


And if your branding is simple (i.e. not much graphics or large amounts of data) you could include it all in the same project/solution or perhaps use conditional compiling. I have an app with multiple brandings and all the data is kept in a single data file (the user can change the 'branding' at runtime, which changes the colours, online data sources, etc).




I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.


Simple pagination is not so simple

Hi RobGMiller,


As per my understanding, you want to set each customer group to start at the first line of a page, you set KeepTogether to true for the groups, but page break does not work properly.


In Reporting Services, we can add a page break to rectangles, data regions, or groups within data regions to control the amount of information on each page. Adding page breaks can improve the performance of published reports because only the items on each page have to be processed as you view the report. To add a page break to a row group in a table, please refer to the following steps:



  1. In the Grouping pane, right-click a row group, and then click Group Properties.

  2. On the Page Breaks tab, select Between each instance of a group to add a page break between each instance of a group in the table. Optionally, select Also at the start of a group or Also at the end of a group to specify that a page break be added when a group starts or ends in the table.


In addition, in Reporting Service, the physical page size is the paper size, and the default PageSize is 8.5 x 11 inches. If the report body grows past the right edge of the physical page, then a page break is inserted horizontally. If the report body grows past the bottom edge of the physical page, then a page break is inserted vertically. The PDF renderer is a physical page renderer, it is usually recommended that we select the target group and set the "Keep Together" property to "True". This can avoid page break within an instance of a group in some cases.


For more information about Pagination in Reporting Services, please refer to the following document:

http://ift.tt/1FzQMhU


If you have any misunderstanding, please feel free to let me know.


Thanks,

Wendy Fu


If you have any feedback on our support, please click here.


Simple pagination is not so simple

Hi RobGMiller,


By design, we add a page break to groups within data regions to control the amount of information on each page.


Many report items within a report can be kept together on a single page implicitly or explicitly by setting the keep with group or keep together properties. Report items are always rendered on the same page if the report item does not have any logical page breaks and is smaller in size than the usable page area. If a report item does not fit completely on the page on which it would usually start, a hard page break is inserted before the report item, forcing it to the next page.


For more information about keeping report items together, please refer to the following document:

http://ift.tt/1yt11B3


If you have any misunderstanding, please feel free to let me know.


Thanks,

Wendy Fu


Matrix4x4

Microsoft.Kinect.Fusion Namespace

http://ift.tt/1y76Bvi



Matrix4x4 Structure

http://ift.tt/128hvmp



- Wayne


How can I convert Bigint value which produced with Timespan?

TimeSpan ts = new TimeSpan(bigintvalue);


It is not clear from your post what the scale of your bigint value is, but the scale for the value to the TimeSpan constructor is 100 ns, so you may have to multiply or divide to the correct scale.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

How can I convert Bigint value which produced with Timespan?


CREATE TABLE Timing (
StartTime DATETIME
,EndTime DATETIME
,ResultTime BIGINT
,ElapsedTime VARCHAR(20)
)

insert into Timing (StartTIme, endtime) values
('2014-11-20 14:35:42','2014-11-28 14:36:15')

DECLARE @MyNullTime TIME
SET @MyNullTime = '00:00:00'

SELECT StartTime,EndTime
,DATEDIFF(MILLISECOND, starttime, EndTime) AS 'tResultTime (MS)'
,cast(DATEDIFF(HOUR, starttime, EndTime) / 24 AS VARCHAR(5)) + 'day(s) '
+ cast(DATEADD(SECOND, - DATEDIFF(SECOND, EndTime, StartTime), @MyNullTime) AS VARCHAR(8)) AS 'Elapsed Time'
FROM timing





-Vaibhav Chaudhari


How can I convert Bigint value which produced with Timespan?

Hi,


you can user TimeSpan to convert this bigint : see this :


http://ift.tt/KE9Diz


You just have to use the right method of this class, it is very simple


HOPE IT HELPS


How can I convert Bigint value which produced with Timespan?

@Vaibhav Chaudhari,


Thanks a lot for rapid solution. Appreciate. That is exactly what I need. Thumps up


How can i get end balance

You can use integer value while using between operator.



AND balance BETWEEN 10 AND 100



You can typecast to integer and use in between operator. To deduce exact answer can you post actual dataset you are using.




Tech


How can i get end balance

Your question is not clear...


Are you looking for the below? If not, please provide sample data and your desired output....



SELECT tday,SUM(balance) AS 'Total Balance'
FROM savta
WHERE prodid = 'S004'
--AND tday ='2014-09-01'
AND balance BETWEEN '10' AND '100'
Group by tday


SSRS - A Subreport background image is overridden by background image of parent report

Hi Vicky,


Thanks for your reply. My issue is the other way around. The image of my main sub report is showing on my sub report, ignoring the conditional imaging I have on my sub report.


Let me explain the scenario:


My main report is a parent that can will have the image turned on based on a condition. The sub reports which are children to the main report also have an image that is turned on based on a condition.


If the parent's decision is to turn the image on, then that image overrides the sub report's conditional imaging and all the sub reports get the parent's image.


If the parent's decision is to turn the image OFF, then that image being turned off overrides the sub report's conditional imaging and all the sub reports don't get an image either.


The bottom line is because both the parent and sub reports have conditional imaging, the sub reports will always get what the parent decides.


The way I proved that the sub reports conditional imaging worked is I took the imaging completely off the parent report, ran the report, and then the sub reports turned the image either on or off based on the condition.


What I need is for the sub report to make its own decision on whether to show the background image regardless of the what the parent is doing to itself.


Thanks,




James


Unable to Migrate ReportSnapshot history using RS.exe for SSRS Reports

We are in process of migrating SSRS reports from older version i.e. SSRS 2005, SSRS 2008 and SSRS 2008 R2 to new version i.e. SSRS 2014. Hence we restore the report server database from source to intermediate server and from intermediate server we leverage RS.exe to migrate report to new destination server i.e. SSRS 2014. However we are not able to migrate ReportSnapshot history using RS.exe


Kindly suggest some solution. We want ReportSnapshot history as well


Many Thanks


- Pankaj Rathod


Unable to Migrate ReportSnapshot history using RS.exe for SSRS Reports

Hi PankajR,


According to your description, you are migrating SSRS reports from old version to new version using rs.exe, after restore report server database to new server, you found that snapshot history is not migrated.


In Reporting Services, we can copy content items (for example reports and subscriptions) and settings from one SQL Server Reporting Services report server to another report server, using the RS.exe utility. Based on my search, the history settings are migrated, but we will lose report history and report execution log data.


I am afraid there is no other approach to work around the issue. If you have any concerns about this feature, you can submit a new feedback to Microsoft Connect at this link http://ift.tt/VjAaDd. Your feedback is valuable for us to improve our products and increase the level of service provided. Thanks for your understanding.


For more information about Items and resources the script migrates, please refer to the following document:

http://ift.tt/1giNg2H


If you have any more questions, please feel free to ask.


Thanks,

Wendy Fu


If you have any feedback on our support, please click here.


foreach for multiple values

Hi ,


in the foreach statement, you can use $i.site, $i.etablissement and $i.departement.


Please let me know if you have any further questions.





Nico Martens

SharePoint/Office365/Azure Consultant


Workflow does not start when PowerShell Script is run from Task Scheduler

Incorrect configuration may cause this.


Try following.


1. Run powershell script using a batch file.


powershell .\scriptname.ps1


2.


make sure following configuration.


Action Start Program


C:\Scripts\scriptname.bat


Start in C:\Scripts\


Select "run whether user logged in or not."


Sometime you may be running higher version of powershell that may also be issue. i faced this issues when i were trying to run powershell for sharepoint 2010 on Windows server 2012.


So you can use following command in batch file.


powershell -version 2 .\scriptname.ps1


How to convert PDF TO EXCEL File using Freeware DLL

Hi,


You may use this .Net assembly to convert PDF to Excel (.xls).


Let us say, you want to convert only tabular data (and skip text) from PDF to Excel in C#:



SautinSoft.PdfFocus f = new PdfFocus();
f.OpenPdf(@"d:\Invoice.pdf");

f.ExcelOptions.ConvertNonTabularDataToSpreadsheet = false;

if (f.PageCount > 0)
f.ToExcel(@"d:\Invoice.xls");



Or if you want to convert textual and tabular data from PDF to Excel, but only on 1st page:



string pathToPdf = @"c:\Table.pdf";
string pathToExcel = Path.ChangeExtension(pathToPdf, ".xls");

// Here we have our PDF and Excel docs as byte arrays
byte[] pdf = File.ReadAllBytes(pathToPdf);
byte[] xls = null;

// Convert PDF document to Excel workbook in memory
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.ExcelOptions.ConvertNonTabularDataToSpreadsheet = true;


f.OpenPdf(pdf);

if (f.PageCount > 0)
{
xls = f.ToExcel(1,1);

//Save Excel workbook to a file in order to show it
if (xls!=null)
{
File.WriteAllBytes(pathToExcel, xls);
System.Diagnostics.Process.Start(pathToExcel);
}
}

I hope this would be helpful for you!


Max



Matrix4x4

Hi, all,


how can I use the Matrix4x4 struct in C# using Microsoft Visual Studio Express 2013 for Desktop?


Haven't been able to add the proper reference and to find the proper documentation.


PD: tried including System.Numerics;




Fito - DeFacto Ing.


Matrix4x4

You can also use some third party libraries like Math.Net numerics.

How can I convert Bigint value which produced with Timespan?

TimeSpan ts = new TimeSpan(bigintvalue);


It is not clear from your post what the scale of your bigint value is, but the scale for the value to the TimeSpan constructor is 100 ns, so you may have to multiply or divide to the correct scale.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Fetch XML data stored in database table column dynamically

Please post a concise and complete example. Include table DDL and sample data INSERT statements.


Cause the solution depends on your actual structure. Otherwise take a look at the nodes() method.


E.g.



DECLARE @Sample TABLE
(
ID INT IDENTITY ,
Data XML
);

INSERT INTO @Sample
( Data )
VALUES ( '<RiskEndorsement><ExistingExposureSplitLimitsChange><NewRiskLimitSeq>536504</NewRiskLimitSeq><EffDate>11/1/2011</EffDate></ExistingExposureSplitLimitsChange></RiskEndorsement> ' ),
( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>NY</StateCode><EffDate>4/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197608</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.890</ExModFactor><SplitDate>3/11/2012</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>197613</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>0389463</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.970</ExModFactor><SplitDate>1/13/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><MandatoryStateRateSplit><StateCode>AL</StateCode><EffDate>7/1/2011</EffDate></MandatoryStateRateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>208975</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>230094357</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.8700</ExModFactor><SplitDate>1/1/2012</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213467</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>2431638</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.6800</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><NonAnniversaryExModSplit><RiskBureauSeq>213473</RiskBureauSeq><RiskIDStatusSeq>1615</RiskIDStatusSeq><RiskIDNbr>917661014</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.860</ExModFactor><SplitDate>10/1/2013</SplitDate></NonAnniversaryExModSplit></RiskEndorsement> ' ),
( '<RiskEndorsement><AnniversaryRatingDateSplit><RiskBureauSeq>213497</RiskBureauSeq><RiskIDStatusSeq>1616</RiskIDStatusSeq><RiskIDNbr>1146456</RiskIDNbr><ExModStatusSeq>1607</ExModStatusSeq><ExModFactor>0.830</ExModFactor><SplitDate>10/1/2013</SplitDate></AnniversaryRatingDateSplit></RiskEndorsement> ' );

SELECT ID ,
ExistingExposureSplitLimitsChange.value('NewRiskLimitSeq[1]', 'INT') AS NewRiskLimitSeq ,
ExistingExposureSplitLimitsChange.value('EffDate[1]', 'DATE') AS EffDate
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/ExistingExposureSplitLimitsChange') A ( ExistingExposureSplitLimitsChange );

SELECT ID ,
MandatoryStateRateSplit.value('StateCode[1]', 'NVARCHAR(255)') AS StateCode ,
MandatoryStateRateSplit.value('EffDate[1]', 'DATE') AS EffDate
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/MandatoryStateRateSplit') A ( MandatoryStateRateSplit );

SELECT ID ,
NonAnniversaryExModSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
NonAnniversaryExModSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
NonAnniversaryExModSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
NonAnniversaryExModSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
NonAnniversaryExModSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
NonAnniversaryExModSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/NonAnniversaryExModSplit') A ( NonAnniversaryExModSplit );

SELECT ID ,
AnniversaryRatingDateSplit.value('RiskBureauSeq[1]', 'INT') AS RiskBureauSeq ,
AnniversaryRatingDateSplit.value('RiskIDStatusSeq[1]', 'INT') AS RiskIDStatusSeq ,
AnniversaryRatingDateSplit.value('RiskIDNbr[1]', 'INT') AS RiskIDNbr ,
AnniversaryRatingDateSplit.value('ExModStatusSeq[1]', 'INT') AS ExModStatusSeq ,
AnniversaryRatingDateSplit.value('ExModFactor[1]', 'FLOAT') AS ExModFactor ,
AnniversaryRatingDateSplit.value('SplitDate[1]', 'NVARCHAR(255)') AS SplitDateText
FROM @Sample S
CROSS APPLY S.Data.nodes('/RiskEndorsement/AnniversaryRatingDateSplit') A ( AnniversaryRatingDateSplit );


Fetch XML data stored in database table column dynamically

see


http://ift.tt/1vTiYuj




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


Fetch XML data stored in database table column dynamically

Thanks Bob. Yes I am getting values as row type. I am glad.


Could you please tell me if I can get values column wise? Is it possible???





windows phone 8.1 how to capture events of zooming in or out?

Hi, I am trying to capture events such as zoom in or zoom out in WebView element, but I found nowhere to find such event in this control, any idea?


Many thanks!


Have a great Thanksgiving Day




Never Give Up!



change report manager HTML rendering view %

Hi All,


I can change the default HTML Zoom % in report server reports accessed via URL. Add "&rc:Zoom=75 " to the URL and it works. However I cannot change the zoom for report manager reports. Is there any workaround to this? or better idea to change HTML rendering?


Thanks


change report manager HTML rendering view %

sorry didnt get that


what do you mean by report manager reports? you mean viewing from report?




Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


change report manager HTML rendering view %

Hi Visakh,


sorry if it wasn't clear. What I'm talking about is the Zoom when report manager opens a report in web browser. on the top tool bar you get a option to change the zoom % . currently reports default to 100% but is it possible to change this when a report is opened to say 75%?


Thanks


Textbox auto populate Number when user entered

PLEASE give me more détails :


always 66-333333 OR WHEN and what's mean this number ?


and when it appears so user can't write anything in this textbox?


Thursday, November 27, 2014

C# code

Hi,


Because your issue in on C# code, I moved this thread to Visual C# forum. C# experts there will provide you better support.


Thanks,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


C# code

Hi Mennis,

Based on your code, I saw some class like(MediaState, GraphicsDeviceManager Class), they are in microsoft.xna.framework.game.dll. So your case related to XNA. I am afraid this is out of our support. You can consider posting it in XNA forum for more efficient responses. This is the link http://ift.tt/1kwsptD. Thanks for your understanding.


Have a nice day!




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Textbox auto populate Number when user entered

Hi All,


I have one Requirement..can any one suggest me how to approach...


I have one Text box, when user enters numbers into text box it will automatically format like this 66-3333333


When page loads textbox is empty.



When user tries to enter data into Text box it will populate automatically in the below format.



Can any one suggest me...


Thanks in Advance...


SharePoint lists are not showing in SharePoint designer "Lists and Libraries" section

Hello,


I think list is broken that's why it is not visible. Can you create new list and check again? If still face issue then create list in any subsite and verify whether it is visible in subsite or not in designer.




Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help


Access Web form looks different on Internet Explorer

Hi Zhengyu Guo,


I am on IE7 and windows XP but developing with access 2010 (in process to be upgraded to W7 and IE9).


I tried to create few new forms but it look like if the original form "corrupted" has to be fixed first, for now any "New form" appear with a corrupted format.


I will try to change the format of the first corrupted form and keep you updated.


Thank you again for your answer.


Tristan


SharePoint lists are not showing in SharePoint designer "Lists and Libraries" section

Hello,


I think list is broken that's why it is not visible. Can you create new list and check again? If still face issue then create list in any subsite and verify whether it is visible in subsite or not in designer.




Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help


Closing and Opening Stock

can you show some sample data from the table?


Please Mark This As Answer if it solved your issue

Please Mark This As Helpful if it helps to solve your issue

Visakh

----------------------------

My MSDN Page

My Personal Blog

My Facebook Page


SSRS distinct lookupset function URGENT

Hi jhowe1,


According to your description, you are using Lookupset function to return sequence numbers. The problem you are facing is that it returns multiple sequence numbers, and you want to remove the duplicate values.


By design, Lookupset function returns the set of matching values for the specified name from a dataset that contains name/value pairs where there is a 1-to-many relationship. LookupSet does the following:



  • Evaluates the source expression in the current scope.

  • Evaluates the destination expression for each row of the specified dataset after filters have been applied, based on the collation of the specified dataset.

  • For each match of source expression and destination expression, evaluates the result expression for that row in the dataset.

  • Returns the set of result expression values.


Multilookup Function returns the set of first-match values for the specified set of names from a dataset that contains name/value pairs. In this case, we can use the function like below:



=Join(MultiLookup(Split(Fields!itemId.Value & Fields!UseByDate.Value & Fields!rackId.Value,","), Fields!itemId.Value & Fields!UseByDate.Value & Fields!rackId.Value, Fields!CustomerSeqNo.Value, " PickingList"),",")



For more information about Multilookup Function, please refer to the following document:

http://ift.tt/1uHPfkV


If you have any more questions, please feel free to ask.


Thanks,

Wendy Fu


If you have any feedback on our support, please click here.


SSRS distinct lookupset function URGENT

Hi Wendy, Thanks for your response, just incase this doesn't give me the results I want, how could I do a format expression to say if sequence field is 1,1 or greater just chop the digits off so I'm just left with 1? I would have to allow for the possibility of 1,2, 1,3 etc., just the duplicate 1 sequence numbers I want removing...

CAML query IN Clause limiation

Hi All,


I am trying to avoid joining the main document library list with another lookup custom list by first search the lookup custom list and get the document IDs to search them in the document library using IN clause.


The problem with the IN clause is that it does not support more than 500 items, after than an exception is report "unable to handle search query".


I am looking for the recommended solution for this problem.


B.S. I have read an incomplete post "http://ift.tt/1xP8zLT" that suggests dividing the IN statements into bulks of 500 items, but this did not work with me either.


In my example:




<Where>
<In>
<FieldRef Name="ProgId" />
<Values>
<Value Type='Number'>6</Value>
-------------------more than 500 times.
<Value Type='Number'>10006</Value>
</Values>
</In>
</Where>



Thanks,





CAML query IN Clause limiation

Hi,


Please go through below link


http://ift.tt/1xYtMqr


Regards


Soni K


CAML query IN Clause limiation

Hi,


The CAML query string like this:



<or>
<or>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
</or>
<in>
<fieldref name="ProgId" />
<values>
500 values at most
</values>
</in>
</or>

Best Regards




Dennis Guo

TechNet Community Support