Monday, September 30, 2013

Manage ProgressBar from a DownloadClass

Hi JackieLeManchic,


ProgressBar.Value is inaccessiable? The Value property of ProgressBar.Value should be both readable and writable. Maybe you could try to binding a value instead of set a value.


Best Regards,


--James




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


Manage ProgressBar from a DownloadClass

Hi Jackie,


Take a look at this sample: http://code.msdn.microsoft.com/windowsapps/Basic-Controls-29318599.The second scenario is talking about ProgressBar, and the value is binding to a SliderBar.


Your code can be used to set the value for progressbar, check what is the maximum of your progressbar, if max is 100, but you set a percentage value to it, surely you will see nothing.


Best Regards,


--James




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


Create a Setup in windows application along with the database

Hai, how do i create setup along with the database file inside the setup?

So, when the setup is finished installing, the database which is saved in the certain folder, will be automatically placed in the target machine along with the application.



So, the application could used by user, because my application is connected to the database, without database, the application became useless.



But, how do i do that?



Could you guys help me? Thanks

Create a Setup in windows application along with the database

Create a Setup in windows application along with the database

C# if apps

Hello Guys



Sorry for asking a question like this but i don't know where else to ask this. I'm studying computer science at a university my problem is my program development teacher gave us a homework. The homework is write 20 "if" statement apps in c# console but i cannot think of 20 different "if" apps. Can someone please give some ideas of simple "if" apps because I can write the code i just can't think of 20 apps i got like five :

-an app that asks for two number and then tells you which is bigger-an app that asks for a number than it tells you to if it can be divided by 2
-a "guess the number" app
-an app that asks for a number than it decides if its positive or negative
-a font color choosing app


So i need help for writing like 15 more but i can't think of anything else.

Thanks !


C# if apps

Hello,


I have moved it to Visual C# forum for better response.


Best regards,




Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


Sorting a list in C# based on a particular value in the item


void OrderTest()
{
//this.player.Source = new Uri("ms-appx:///Assets/recit24bit.flac", UriKind.Absolute);
//this.player.Source = new Uri("ms-appx:///Assets/Stellardrone - Aurora.mp3", UriKind.Absolute);

var list = new List<MyClass>()
{
new MyClass { strValue = "s1", dobValue = 1},
new MyClass { strValue = "a2", dobValue = 4},
new MyClass { strValue = "d3", dobValue = 1.5},
new MyClass { strValue = "g4", dobValue = 1.9},
new MyClass { strValue = "asdasd", dobValue = 9.7},
new MyClass { strValue = "fefes1", dobValue = 5.7},
};

var ordered = list.OrderBy(a => a.dobValue);
}


model:



public class MyClass
{
public string strValue { get; set; }
public double dobValue { get; set; }
}


using Aggregate function on Parameter value

Hi, I am using SSRS 2008 R2 and writing an expression to get the Maximum & Minimum values from a multi value parameter. This expression does not throw any error or return anything. I looked for msdn documentation to see if it said not to use Aggregate functions on Parameters but nothing as such has been documented so far. I was wondering how would I do this?


Thanks in advance.........




Ione


Table header doesn't repeat on new page after applying hot fix

Good day,


I am working on a report that uses a Tablix. I want the headers of the Tablix to report on every new page. I clicked in the Tablix Properties to repeat header rows on each page and keep header visible while scrolling. But headers do not repeat. I also went on the internet and downloaded the latest HotFix that was recommended to fix this problem but the headers still do not repeat. Is there something that I am missing.


Table header doesn't repeat on new page after applying hot fix

Which version of Reporting Services are you using?


Table header doesn't repeat on new page after applying hot fix

Hi,


Please try the below link for your solution and let us know if it does not resolve your issue:


http://www.sqlcircuit.com/2012/03/ssrs-how-to-repeat-column-header-in.html


Thanks,


Vishal


Table header doesn't repeat on new page after applying hot fix


Good day,


I am working on a report that uses a Tablix. I want the headers of the Tablix to report on every new page. I clicked in the Tablix Properties to repeat header rows on each page and keep header visible while scrolling. But headers do not repeat. I also went on the internet and downloaded the latest HotFix that was recommended to fix this problem but the headers still do not repeat. Is there something that I am missing.





Try this link .


sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.


Table header doesn't repeat on new page after applying hot fix

Microsoft SQL server reporting services designers version 10.50.2500.0

Table header doesn't repeat on new page after applying hot fix

Tried this fix and now I get an error as follow


An error occurred during local report processing


The definition of the report/


The tablix has an invaild tablixMember. All TablixMember. All Tablix memeber elements in a TablixCoulmnHierachy must have the KeepWithGroup property set to "NONE".


Table header doesn't repeat on new page after applying hot fix

The link you sent has no bearing on what I am tring to accomplish.

Table header doesn't repeat on new page after applying hot fix

No this does not resolve my issue. Now I get this error.


Tried this fix and now I get an error as follow


An error occurred during local report processing


The definition of the report/


The tablix has an invaild tablixMember. All TablixMember. All Tablix memeber elements in a TablixCoulmnHierachy must have the KeepWithGroup property set to "NONE".


HOW DO I ADD A SYMBOL TO A DASH PATTERN

Hello,


I have moved this thread to Visual C# forum for better response.


Thanks,




Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


HOW DO I ADD A SYMBOL TO A DASH PATTERN

Hi El-sid,


I think it’s impossible. Because the DashPattern property was an array of float Struct. You could not add a string in it. You should use DrawString method. See http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring.aspx for how to use.


Best Regards,




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


System.printing Namespace

Hai frndz. . . . i want to connect remote printer at server side using C# asp.net pls help me frnds. . . .

System.printing Namespace

You haven't really given much detail on your goal, so all I can do is give you a link to the docs and an example of printing in C#: http://msdn.microsoft.com/en-us/library/vstudio/system.drawing.printing.printdocument(v=vs.100).aspx


If you provide more information, I can help you more than just giving you a link to the documentation.




Wasabi Fan


System.printing Namespace

thank you friend but i trainer said use System.printing namespace and print in network printer. . .

How to find the degree of Normalisation in SQl Server 2008

The Normalization is a part of Logical Design. Sorry, you cannot use a query to find what's the Data Logic!


More info:


Database Normalization




Saeid Hasani, sqldevelop.wordpress.com



Download Books Online for SQL Server 2012


User Access to Report Server (2012) - Server2008 R2 SP1



Yes, you have to add every user to ReportServer to grant access permissions. Other option is to use a Windows domain group for the user, then you have to add only that group to SSRS. And "browse" permissions for the common user is quite enough.


Olaf Helper


[ Blog] [ Xing] [ MVP]

Thanks for the reply. Just be clear on this, I am familiar with adding Windows accounts via the Report Server URL. I refer here to adding users on the report server in Control Panel/Users. As I said I made them admin just as a test, a lesser privilege is obviously more appropriate.


R Campbell



Serialization/Deserialization of multiple objects

Hi,


I have a class, whcih contains certails properties. I want to create multiple objects of this class, and create one single XML file out of that.


Can anyone help on that?



[DataContract]
public sealed class HsdResponseMessage : MessageBase, IMessage
{
[DataMember(Order = 1)] public string RequestMessageFileName { get; set; }
[DataMember(Order = 2)] public string RequestMessageId { get; set; }
[DataMember(Order = 3)] public string HsdRecordId { get; private set; }
[DataMember(Order = 4)] public string HsdException { get; private set; }
[DataMember(Order = 5)] public bool HsdCommitStatus { get; private set; }
[DataMember(Order = 6)] public string Title { get; private set; }
[DataMember(Order = 7)] public string Description { get; private set; }
[DataMember(Order = 8)] public string Steps { get; private set; }
[DataMember(Order = 9)] public int HasAttachments { get; private set; }
[DataMember(Order = 10)] public string AttachmentFileName { get; private set; }
public HsdResponseMessage(MessageHeader header, string fileName, string requestMessageId, string requestMessageFileName, string hsdRecordId, string strTitle, string strDescription, string strSteps, int iHasAttachments, string strAttachmentFileName)
: base(MessageTypeEnum.HsdResponse, header)
{
FileName = fileName;
RequestMessageFileName = requestMessageFileName;
RequestMessageId = requestMessageId;
HsdRecordId = hsdRecordId;
Title = strTitle;
Description = strDescription;
Steps = strSteps;
HasAttachments = iHasAttachments;
AttachmentFileName = strAttachmentFileName;
HsdCommitStatus = true;
HsdException = string.Empty;
}
}


Serialization/Deserialization of multiple objects

Hi,


I know the code to serialize this to XML. Waht I am looking at is : The collection of objects serialization.


mult params web service

I have no problem compiling, maybe you should try Clean Solution


Sincerely, Jakeinc


mult params web service

To avoid this pitfall use the single point of exit idiom:

public string CalculateAmount(string val1, string val2, string val3)
{
string result = string.Empty;
if(val1 == "Level 1")
result = val2;
if(val1 == "Level 2")
result = val3;
return result;
}



btw, Get is a verb which should only be used for implementing getter methods of class properties. Nothing else. Same applies for Set and setter methodes.

mult params web service

How do you step through code in a web service? It stops at the first break point but you can't step into or step over code. It just completes executing the rest of the code.

mult params web service

You normally use unit tests to verfiy the core functionality. This is involves normal debugging, cause unit tests are exectuted on your machine.

what is best answer for "How to optimized SQl Server Query"

You can see this great article:


Query Tuning




Saeid Hasani, sqldevelop.wordpress.com



Download Books Online for SQL Server 2012


what is best answer for "How to optimized SQl Server Query"

1.You need to see an execution plan of the query. (In order to understand how SQL Server process the query)


2.You can SET STATISTICS TIME,IO ON to see what tables are heavily accessed and more.


3. If it is pretty complex query, is there any possibilities to re-write it?


And much more......




Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/



MS SQL optimization: MS SQL Development and Optimization

MS SQL Consulting: Large scale of database and data cleansing

Remote DBA Services: Improves MS SQL Database Performance

SQL Server Integration Services: Business Intelligence


what is best answer for "How to optimized SQl Server Query"

Hi,


Interesting question. Do you want to be able to answer to someone about something you cannot do?


In brief, query optimization is all about analyzing data access paths of the query (or queries) and optimizing those paths. This can be done by applying indexing strategies or by rewriting the query.


The above is true only if you have a system that does not have resource bottlenecks. If you have system with resource bottlenecks, first you have to deal with them and then optimize the queries. Only if you think that poor queries and indexing is the reason of system resource bottlenecks you can start optimize the queries to resolve overall system performance state.




HTH, Regards, Dean Savović


merging multiple rows to a single row

hi im trying to merge multiple rows which are populating to a table.


so i want to merge thoese values into single row.i dont have a common column or any other column.


ex


col


Ab


cd


ef


now to show this in a single row of same table same column as Abcdef


merging multiple rows to a single row

merging multiple rows to a single row


declare @t table(col varchar(10));
insert into @t values('Ab'),('cd'),('ef');
select * from @t

select distinct stuff((select '' + col
FROM @t FOR XML PATH('')), 1, 0, '' ) as col





ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you



merging multiple rows to a single row

Please provide your sample data and table structure, we would be able to help you better.


If you look at the link that provided, you can see grouping and combining, may be you are looking for the one?




Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


Template renderer analog in XAML/C#

In WinJS application itemTemplate property of listview can accept a function in which i can create elements manually.


What is the analog for this approach in XAML/C# applications?


Template renderer analog in XAML/C#

Hi Alex,


in XAML/C# we've also the ItemTemplate-Property. It takes a DataTemplate that lets you define the elements for a single item.


Let's say you've a collection of Person-objects. Each Person has a FirstName and a LastName. Then your ListView with a DataTemplate can look like this:



<ListView ItemsSource="{Binding Persons}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding FirstName}"/>
<TextBlock Text="{Binding LastName}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>





Thomas Claudius Huber



"If you can´t make your app run faster, make it at least look & feel extremly fast"



twitter: @thomasclaudiush

homepage: www.thomasclaudiushuber.com

author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook


drill through parameter screen not visible in SharePoint

Hi Rarjesh,


All the things your description are the default setting in Reporting Services. We can use the action property to drill-through to another report and pass value to that report via parameter. And that report will dispaly the data base on the parameter value. When you add parameters to run report B, so when you click the link in ReportA, then it will use those parameters to run ReportB. We cannot change the parameters value before ReportB was run, the parameter tab is hidden.


Thank you for your understanding.


Regards,




Charlie Liao

TechNet Community Support



I'm having a pop up message "visual c# command line compiler has stopped working"

What codes have u written?


Click For donating:Free Rice For the pool

For spamming-sender issues, you can either report it at Microsoft Spamming Issue , or just find "Report Spam Here+Number" at Forum Issue ;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.

For more things to talk about? StackOverFlow is your choice.


I'm having a pop up message "visual c# command line compiler has stopped working"

So that happens when you create a project with VS2012?


Click For donating:Free Rice For the poor

For spamming-sender issues, you can either report it at Microsoft Spamming Issue , or just find "Report Spam Here+Number" at Forum Issue ;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.

For more things to talk about? StackOverFlow is your choice.


I'm having a pop up message "visual c# command line compiler has stopped working"

Hi Jasmine,


Seems someone else encountered the same problem.


Please check this thread:


http://answers.microsoft.com/en-us/windows/forum/windows_vista-performance/visual-c-command-line-compiler-error-message/55a6cf56-639a-425c-a56c-27378c013713


And check if this workaround helps:


http://support.citrix.com/article/CTX135745


By the way, this is not a Visual C# question.




Caillen

<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


how to connect remote printer in asp.net

Can you tell me what you're trying to achieve using the PrintServer class?


Please remember to 'Mark as Answer' the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


how to connect remote printer in asp.net

If you want to list all printers in a print server:



PrintServer myPrintServer = new PrintServer(@"\\ServerName", System.Printing.PrintSystemDesiredAccess.EnumerateServer);

// List the print server's queues
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
String printQueueNames = "My Print Queues:\n\n";
foreach (PrintQueue pq in myPrintQueues)
{
printQueueNames += "\t" + pq.Name + "\n";
}

MessageBox.Show(printQueueNames);





Please remember to 'Mark as Answer' the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


UPDATE lock on table

I have query like this:



BEGIN TRAN
;WITH CTE AS(SELECT col1, col2,.... FROM dbo.table t1 INNER JOIN dbo.table t2...INNER JOIN table t3 WITH (UPDLOCK)...)
SELECT col1 from CTE c INNER JOIN CTE c1 ON ....




I have put UPDLOCK on one table, which I can see in other window. There is U key lock and IU PAGE lock on that table. Everything as expected.


But if I update the row which is selected in some other window, the update will succeed.


If i write just the select query which is inside CTE:



BEGIN TRAN
SELECT col1, col2,.... FROM dbo.table t1 INNER JOIN dbo.table t2...INNER JOIN table t3 WITH (UPDLOCK)...)



the similar U key lock and IU page lock is putted on the same table, but this time I can't update the same row.


How is that possible? Does it put update lock on some different row in first case, because the query is inside CTE?


How can I see, which row (id) is locked if I have resource description :(bffced99e570) beside key lock? Does anybody has the query?


Thanks, Simon


UPDATE lock on table

Fetch file name from databse to a variable.

????

Fetch file name from databse to a variable.



Try something like this
var records = dbcon.Table<databaseprograms>()("select * from databaseprograms where ProgramChapter = '" + pageTitle.Text + "'");

Fetch file name from databse to a variable.

Hi,


Try to code like this below:



var records = dbcon.Table<databaseprograms>().Where(temp =>temp.ProgramChapter ==pageTitle.Text );
foreach (var sd in records )
{
string filename=sd.filename;//filename is the records property
}

And I suggest you can see this sample about how to use SQLite in windows 8:


http://code.msdn.microsoft.com/windowsapps/Sqlite-For-Windows-8-Metro-2ec7a882/view/SourceCode#content


Best Wishes!




<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>

Thanks

MSDN Community Support



Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


Sunday, September 29, 2013

ListView ItemClicked by RelayCommand - MVVM

In MVVM, we are bind ViewModels to Page.DataContext. So you need to have RelayCommand in VM and bind to it in xaml to attached property.

Splitting number and string using linq

Does this work for you?




string s = string.Concat( NameComp.TakeWhile( c => !char.IsDigit( c ) ) );
string d = string.Concat( NameComp.Skip( s.Length ) );
// or
string d = NameComp.Substring( s.Length );













Splitting number and string using linq

This is how you can do:



string str = "ahde7394";
var array = str.ToCharArray();
var letters = array.Where(w => Char.IsLetter(w)).ToList().Select(s => s.ToString()).ToArray();
var numbers = array.Where(w => Char.IsNumber(w)).ToList().Select(s => (int)Char.GetNumericValue(s)).ToArray();
//new strings:
string newLetter = string.Join("", letters.ToArray());
int newNumbers = numbers.Aggregate((i, j) => int.Parse(i.ToString() + j.ToString())); //to get real number





Mitja


Splitting number and string using linq

rrodri,


It seems that you wanna seperate characters from digits. So I think you can also try this method:



string s = "abcde1234";
string regExp="(?<One>[A-za-z]+)(?<Two>[0-9]+)";
Regex reg = new Regex(regExp);
foreach (Match item in reg.Matches(s))
{
Console.WriteLine(item.Groups["One"].Value); //abcde
Console.WriteLine(item.Groups["Two"].Value); //1234
}



Click For donating:Free Rice For the poor

For spamming-sender issues, you can either report it at Microsoft Spamming Issue , or just find "Report Spam Here+Number" at Forum Issue ;You can also find "Verify Your Account+Number" at "Forum Issue", where you can submit to be confirmed to paste links or images.

For more things to talk about? StackOverFlow is your choice.


SQL server 2008 connection getting. But server agent not showing when we connecting it from another pc

If the SQL SERVER Instance is SQL Express, so you cannot see the agent node!


If the user that you connect with it, has not sysadmin role, so you cannot see the agent node!




Saeid Hasani, sqldevelop.wordpress.com



Download Books Online for SQL Server 2012


SQL server 2008 connection getting. But server agent not showing when we connecting it from another pc

Hi Mujeeb,


1) If your evaluation period has expired, consider doing an edition upgrade to any retail version.


http://blogs.technet.com/b/sqlman/archive/2010/03/16/sql-server-2008-upgrading-to-standard-enterprise-edition-from-evaluation-edition.aspx


2) If you are getting "evaluation period expired message" while launching SSMS even after an edition upgrade for SQL Server 2008, here is the workaround


http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/02/20/sql-server-2008-evaluation-edition-expiration-woes.aspx


Thanks


Please click the Mark as answer button and vote as helpful if this reply solves your problem



Splitting number and string using linq

This is how you can do:



string str = "ahde7394";
var array = str.ToCharArray();
var letters = array.Where(w => Char.IsLetter(w)).ToList().Select(s => s.ToString()).ToArray();
var numbers = array.Where(w => Char.IsNumber(w)).ToList().Select(s => (int)Char.GetNumericValue(s)).ToArray();
//new strings:
string newLetter = string.Join("", letters.ToArray());
int newNumbers = numbers.Aggregate((i, j) => int.Parse(i.ToString() + j.ToString())); //to get real number





Mitja


Splitting number and string using linq

Does this work for you?



string s = string.Concat( NameComp.TakeWhile( c => !char.IsDigit( c ) ) );
string d = string.Concat( NameComp.Skip( s.Length ) );




How to determine the table count by using .bat files

Have a look at these two links:


Specify Synchronization Schedules


Start the Replication Monitor




Saeid Hasani, sqldevelop.wordpress.com



Download Books Online for SQL Server 2012


Read SharePoint Groups in Javascript

I created SharePoint Group Called "MyTestGroup" and this group has users and other Active Directory Groups. I read all users and groups inside "MyTestGroup" but i don't know how get users in the Active Directory groups.

Overview of apps being featured by MS (spotlight)

When I go to the Windows Store I see apps being featured in the Spotlight section for my countries.


Is there a way to see which apps are being featured in other countries?


In windows phone I can use this page


http://www.windowsphone.com/en-us/store


and change en-us to other countries....


Overview of apps being featured by MS (spotlight)

Hi.


ControlPanel -> Region -> Location -> select location for change store apps.


Developing apps for windows 8 tablet

Hi,


I need to develop apps for windows 8 tablet, no need to develop for windows 8 desktop and laptop.


Please suggest me the right way.


Developing apps for windows 8 tablet

Hello my Win 8 game.



You will love it..



City Birds Game:

Now get more of the exhilarating running, flying, shooting, and power-ups you are gonna love!!

Navigate fast cities, dodge obstacles and fighter planes as you try to escape with the cursed city of humans. How far can you fly?!

FEATURES

★ Beautiful new graphics

★ Gorgeous environment

★ New obstacles

★ More powerups

★ Magic Potions

★ Special characters

★ Killer Spikes!!!

Downlad for Windows 8:
http://apps.microsoft.com/windows/en-us/app/city-birds/ca9c76a8-a88e-415d-a78e-df1f53efa186

Counld anybody help me delete registry value Recursively?

Thanks, it seems that I have to catch and ignore the exception...

How to find the reason of Fragmentation ?

Read


http://www.practicalsqldba.com/2012/04/sql-server-index-fragmentation.html


http://blog.sqlauthority.com/2010/01/12/sql-server-fragmentation-detect-fragmentation-and-eliminate-fragmentation/


http://www.mssqltips.com/sql-server-tip-category/39/fragmentation-and-index-maintenance/




Many Thanks & Best Regards, Hua Min



How to find the reason of Fragmentation ?

Hi,


http://blog.sqlauthority.com/2010/01/12/sql-server-fragmentation-detect-fragmentation-and-eliminate-fragmentation/




Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/


How to find the reason of Fragmentation ?

AUTOSHRINK setting on database may cause index fragmentation.


You can decrease index fragmentation if you use FILLFACTOR on dynamic tables (lots of INSERTs):


http://www.sqlusa.com/bestpractices2008/rebuild-all-indexes/


Use FILLFACTOR 70 (30% empty space) on extreme dynamic tables.


Use FILLFACTOR 80-90 on dynamic tables.


Optimization article:


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


BOL: "A correctly chosen fill factor value can reduce the potential for page splits by providing enough space for index expansion as data is added to the underlying table.".


http://msdn.microsoft.com/en-us/library/ms177459(v=sql.90).aspx




Kalman Toth SQL SERVER 2012 & BI TRAINING

New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012











How to find the reason of Fragmentation ?

This article describes the different reasons for fragmentation and what you can do about it:


http://gertjans.home.xs4all.nl/sql/fragmentation-hurts-performance.html




Gert-Jan


C# - How to make a Button with a DropDown Menu?

check the below link... u can download the code...



http://www.codeproject.com/KB/buttons/SplitButton.aspx



hope this helps....





Narayanan Dayalan - Zeetaa Business Solutions ------- Please "Mark As Answer", if my answer works well with ur Query

C# - How to make a Button with a DropDown Menu?

Can you post the code?

C# - How to make a Button with a DropDown Menu?

Harry, thanks a lot ~~


C# - How to make a Button with a DropDown Menu?

Hi,


Thanks a lot.


For Creating a Dropdown Menu I had created a dropdown using panel but it was having some problems.


This code really helped me as I wanted to do the same.





C# - How to make a Button with a DropDown Menu?

Custom Button Controls,


http://www.kettic.com/winforms_ui/buttons_overview.shtml


How to determine the table count by using .bat files

Dear all,


We're using sql server 2005 standard with merge replication and want to monitor the replication status or table count on both servers daily by using windows schedule job(.bat). Any simple code to achieve this?


Thanks and regards,


Wallace Chan


DIFFERENCE BETWEEN "INSERT INTO" AND UNION IN SQL


Hi SB!


Sure do oblige your presenting the main difference! So I guess with different data structures existing and duplicates to be checked out I'll have to continue with "INSERT INTO"!


Thanx again buddy!




Best Regards, Faraz A Qureshi



Nope, Insert Into also doesn't check it and doesn't even give unique rows.


If you want unique rows, you should UNION instead of UNION ALL.




Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.


DIFFERENCE BETWEEN "INSERT INTO" AND UNION IN SQL

In and of itself, "INSERT INTO" does not remove any duplicates. Typically, "DISTINCT", "GROUP BY" or "ROWNUMBER() .. = 1" is used to select unique rows.


One you have unique rows, it is up to you to determine what to do with them. If you want to store the unique rows, then you would be using "INSERT INTO" (or "SELECT .. INTO").






Gert-Jan


Getting HTML-code from a source using javascript part 2

Hi,


Unfortunately my previous question on this matter seems to be closed because I had an unexpected holiday. To try again:


I have a webbrowser control in my application, with the browser I navigate to certain pages containing javascript. On one of these pages there is an outerpage and an innerpage (not sure how this is called). The innerpage contains results I want to analyse and save. For this I need the HTML-text. Pointing the mouse to the innerpage and right-clicking the mouse gives me a dialog with, among others, the possibility to view the source code; that is exactly what I need. But how can I get this (just like the browser produces the HTML-text) in a string for analysing?


I tried using the DOM etc. but I can't get to the innerpage. If the webbrowser control can produce what I need there must be a simple way to do the same and fetch the HTML-text programmatically (somewhere the text written to screen should be captured).


Anyone any ideas for this seemingly easy operation?


Getting HTML-code from a source using javascript part 2

Select the "innerpage" element, then inspect the InnerHtml property.

Getting HTML-code from a source using javascript part 2

That is, I think, just the problem, I do not know how to get to the "innerpage" element through a cascading of javascripts. I had hoped that there would be a simple way (method, property) around this that will fetch me the HTML-source code at the moment I arrived at the "innerpage" I was aiming for, just as the view source does in the webbrowser. In the debugger I can see that an enormous object is build with an amount of levels that even the debugger can hardly handle when I try to find the HTML I need.



Is the answer that you can not extract the HTML-source from the webbrowser in a simple way even when you navigate to the "innerpage" manually (by mouseclicks)? And if so, are there no libraries or tools that facilitates this? I am not unwilling to dive into this stuff, but my time is restricted and for now I am only interested in getting a result instead of weeks of learning, searching and experimenting (educational as it is).



So the question is, can this be done easily somehow or is the only way that of labour and learn?

Getting HTML-code from a source using javascript part 2

This depends on how the JavaScript manipulates the HTML.. Thus it could be hard, as long as you don't dive into it really deep.


The first step would be using a HTML debugging tool like the F12 developer tools in IE. Or FireBug in FF. Activate the tool and select the "innerpage" in your browser. This is basically all you can get with simple methods (innerHTML).


Getting HTML-code from a source using javascript part 2

Thanks Stefan,


I finally managed to solve my problem, using F12 I incidentally found there is a way to skip the outerpage, from there on I can easily navigate through the other pages and fetch the HTML-source with the information I want to save and analyse in my program. Probably I am even able to reach the pages fully automated so manual navigation is not necessary (but even without it's fine).


Again thanks for the support, I will mark the subject as answered.


How to used the PickerClosingOperation.GetDeferral | getDeferral method

Hi,


How to used the PickerClosingOperation.GetDeferral | getDeferral method?


In my app, I called follow codes,



async void fileOpenPickerUI_Closing(Windows.Storage.Pickers.Provider.FileOpenPickerUI sender, Windows.Storage.Pickers.Provider.PickerClosingEventArgs args)
{
var defer = args.ClosingOperation.GetDeferral();
storage file = await SaveToFileAsync("aaaa", filePath);
defer.Complete();
}

but it doesnot work well, it's not async? how can I do it?


Thank you!




自强不息,知行合一。


How to used the PickerClosingOperation.GetDeferral | getDeferral method

Can you please explain what's not working properly?


Matt Small - Microsoft Escalation Engineer - Forum Moderator

If my reply answers your question, please mark this post as answered.



NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


How to used the PickerClosingOperation.GetDeferral | getDeferral method

Some ideas?


自强不息,知行合一。


Is there a way to suppress the onscreen keyboard from popping up?

The input pane is controlled by the user, not the app. It will appear when the user touches a text input control (whether a physical keyboard is attached or not is not relevant). See The touch keyboard for details.


Why do you want to have a control that accepts input but that the user cannot use? How are users who don't have a keyboard supposed to use your app? What is the scenario here?


--Rob


SQL server 2008 connection getting. But server agent not showing when we connecting it from another pc

When evaluation period is expired you can't use SQL Server Agent and SSMS.


But SQL Server continued to work.




Systems Analyst


DIFFERENCE BETWEEN "INSERT INTO" AND UNION IN SQL

Thanx SK!


Now that's what I call really Helpful, buddy! Sure found it to be an excellent explanation and guidance.


Thanx again!




Best Regards, Faraz A Qureshi


DIFFERENCE BETWEEN "INSERT INTO" AND UNION IN SQL

Hi SB!


Sure do oblige your presenting the main difference! So I guess with different data structures existing and duplicates to be checked out I'll have to continue with "INSERT INTO"!


Thanx again buddy!




Best Regards, Faraz A Qureshi


Passing params value by a query to multiselect param of report through Data driven subscription

I have a report (build in SSRS 2008R2)which has period_name as a multivalue parameter. I have created Data driven subscription and have written a query in subscription which fetches multiple values of period_name on a condition written. But instead of creating one report for all the param values its creating separate report for each period_name value and sending that many reports in a separate mail.


For example I have got 5 emails having report for each period_name written by that subscription query. But I want a single report for all the priod_names. Please let me know is there any setting in subscription which I need to do. This is an urgent requirement.








Nilima



Passing params value by a query to multiselect param of report through Data driven subscription

Someone please reply on this. At Least let me know if it is possible to implement or not ?


Nilima


Passing params value by a query to multiselect param of report through Data driven subscription

Hi Nilima,


For a MultiValue parameter, it is actual an Array data type. We need to pass an array value for it. However, so far, there is no array data type in current SQL Server versions. It means, it is still unable to pass values got from SQL Server to MutliValue parameter through report manager.


The solution to make it works is using SQL Server Reporting Service(SSRS) SOAP API.

http://social.technet.microsoft.com/Forums/sqlserver/en-US/bb9d31f7-8e4e-4d52-8696-66556ce92e15/ssrs-2005-webservice-programatic-multiple-parameters


We also have another workaround. It is using single value parameter instead of MultiValue parameter, and using Split function to split the string into array. Please see the following two articles for more detailed:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9ce92c7a-d136-46f7-85a2-1323ab242867/using-multivalued-paramters-with-datadriven-subscriptions

http://blogs.msdn.com/b/lukassteindl/archive/2013/04/19/data-driven-subscriptions-with-multi-value-parameters.aspx


Thanks,

Jinchun Chen




Jinchun Chen(JC)

TechNet Community Support



How can Save Tree view Checked and Uncheked node data in database

Hi,


for Checked nodes do it like:



SqlConnection conn = new SqlConnection(strConnString);
con.Open();
foreach (TreeNode item in this.TreeView1.CheckedNodes)
{
string query = "INSERT INTO TableName VALUES ('" + item.Text + "')";
SqlCommand cmd = new SqlCommand(query, conn);
cmd.ExecuteNonQuery();
}
con.Close();









Mitja


Not displaying properly "thai" character while exporting to PDF


  • Any idea on this ?


Not displaying properly "thai" character while exporting to PDF

Please advise on some settings changes for this.

Not displaying properly "thai" character while exporting to PDF

Not displaying properly "thai" character while exporting to PDF

SP3 is already there. Actually it is working for some other reports , but for this report alone it is not correctly exporting to PDF (so i guess, it should be related to some local VS properties change)

Not displaying properly "thai" character while exporting to PDF

Any idea?

Not displaying properly "thai" character while exporting to PDF

Hi UltraDev,


According to your description, it is contains thai character in your report. This problem occurs because the glyph IDs for some non-English characters have changed in some font files.


As Pradeep post earlier, we can try to install SP3 to solve the issue. However, the issue is posist in your report. To work around this problem, install the same versions of the font files on the server computer and on the client computer.


There is a KB article about Incorrect characters appear in a SQL Server Reporting Services report after you export it to a PDF file, you can refer to it.

http://support.microsoft.com/kb/955495


Regards,

Alisa Tang


SSRS - Make a section header for a group to save horizontal space

In your detail row, right-click on an individual cell and find the add row group area. Make sure it's Row Group and not Column Group here if you're in a tablix)


When you create the parent group you will have the option of adding a header row. Once created you can format it to fit your needs.


HTH


Saturday, September 28, 2013

how insert excel date into sql table?

Hi,


The are multiple ways of importing excel data to SQL Server. Details of these methods can be found at http://support.microsoft.com/kb/321686/en-us


-Vatsalya




Vatsalya - MSFT The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Microsoft.


how insert excel date into sql table?

Data can also be transferred from Excel via COPY & PASTE using the Edit Top 200 Rows feature in Object Explorer (table right click drop-down menu).




Kalman Toth Database & OLAP Architect IPAD SELECT Query Video Tutorial 3.5 Hours

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012



how insert excel date into sql table?

Finally, here are a couple more resources for you.


http://go4answers.webhost4life.com/Example/import-excel-file-sql-server-64-bit-157244.aspx


http://colinmackay.co.uk/2011/08/12/running-queries-on-excel-spreadsheets-using-sql-server-2008/




Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.


Deploying Windows Store Apps From VS2012 to my machine crashes with System.AccessViolationException

Hi,


For some reason I cannot deploy windows store apps to my local machine without crashing VS2012 (update 3). The deploy looks like it has actual worked as the app is available on the metro screen and actually runs. But with the deploy crashing it's making it impossible to develop, and debugging is a complete non - starter.


I've tried various things, running VS with resetaddin and also in safemode (which won't even load a Windows Store App).


I can't even create a basic out of the box app using the templates and deploy that without VS crashing.


My windows 8 version is Version 6.2 (Build 9200) (Debug) from which I installed from MSDN. I really don't want to have to install windows again.


Thanks



Divide students in groups based on preferences


I am writing an application using C#/Asp.Net. In the database i have three tables. (Students, Groups and Preference).


Students


Student Name---------Group ID(Not Data for now)

Student A

Student B

Student C

Student D

Student E

Student F

Student G

Student H

Student I

Student J

Student K

Student L


Preferences Tables


Student Name--------Preference 1--------Preference 2--------Preference 3

Student A------------Student G-----------Student F

Student B------------Student H-----------Student K------------Student L

Student C------------Student I

Student D

Student E

Student F

Student G

Student H

Student I

Student J

Student K

Student L


Groups Table

Group ID

1

2

3


I want to create students groups for Labs based on preferences. Each group will have min 3 and max 4 students. If some students are left without group, that can be adjusted manually. Each student will enter max 3 preferences (optional), who he/she want's to group with. How can i implement this. Any Examples etc? Any help will be much appreciated.



Excel Web Access

The problem is how to dynamically change content (Excel) in Excel Web Access webpart? So F.ex we have 10 users and each of them should see different excel when enter the page. How can I do sth like this?


Thanx for any info.


Why sum is not 6 with this parallel algorithm

I have no idea what you are trying to say. 3 = 2^k for k ~= 1.585. That's not an integer number and such a number doesn't make sense in this context.



Getting HTML-code from a source using javascript part 2

Hi,


Unfortunately my previous question on this matter seems to be closed because I had an unexpected holiday. To try again:


I have a webbrowser control in my application, with the browser I navigate to certain pages containing javascript. On one of these pages there is an outerpage and an innerpage (not sure how this is called). The innerpage contains results I want to analyse and save. For this I need the HTML-text. Pointing the mouse to the innerpage and right-clicking the mouse gives me a dialog with, among others, the possibility to view the source code; that is exactly what I need. But how can I get this (just like the browser produces the HTML-text) in a string for analysing?


I tried using the DOM etc. but I can't get to the innerpage. If the webbrowser control can produce what I need there must be a simple way to do the same and fetch the HTML-text programmatically (somewhere the text written to screen should be captured).


Anyone any ideas for this seemingly easy operation?


how to generate ordered sequence for n number of n number of child

Hi,


I think something like this can help you. Rivers are sorted by id columns and children are under its parent. The query is recursive.


If you don't want recursion in your query consider implementing the hierarchy notation in your table or using hierarchyid data type.



declare @tbl table (id int, rivername varchar(100), parentid int)

insert into @tbl (id, rivername, parentid)
values (1,'r1',null),
(3,'r2',null),
(2,'r3',null),
(4,'akash',3),
(5,'xyz',3),
(6,'r5',null),
(7,'abc',3),
(8,'hkjd',4),
(10,'ksjdf',7),
(19,'ksjdf',7),
(14,'jjj',null)

;with River
as (
select
*
, '.' + replicate ('0', 5 - len(convert(varchar(max), t.id))) + convert(varchar(max), t.id) + '.' as Hierarchy
from @tbl t
where t.parentid is null

union all

select
tC.*
, r.Hierarchy + replicate ('0', 5 - len(convert(varchar(max), tC.id))) + convert(varchar(max), tC.id) + '.'
from @tbl tC
inner join River r on tC.parentID = r.id
)
select
*
from River r
order by r.Hierarchy





HTH, Regards, Dean Savović


how to generate ordered sequence for n number of n number of child

select <>

from yourtable order by isnull(parentid, id), id;


Deploying Windows Store Apps From VS2012 to my machine crashes with System.AccessViolationException

Hi,


For some reason I cannot deploy windows store apps to my local machine without crashing VS2012 (update 3). The deploy looks like it has actual worked as the app is available on the metro screen and actually runs. But with the deploy crashing it's making it impossible to develop, and debugging is a complete non - starter.


I've tried various things, running VS with resetaddin and also in safemode (which won't even load a Windows Store App).


I can't even create a basic out of the box app using the templates and deploy that without VS crashing.


My windows 8 version is Version 6.2 (Build 9200) (Debug) from which I installed from MSDN. I really don't want to have to install windows again.


Thanks



Why sum is not 6 with this parallel algorithm

Why sum is not 6 with this parallel algorithm



/*
integer B[1..n]
forall i in 1 : n do
B[i] := ai
enddo
for h = 1 to k do
forall i in 1 : n/2^h do
B[i] := B[2i-1] + B[2i]
enddo
enddo
S := B[1]

*/

int n = 3;
int[] hello = new int[n+1];
int[] B = new int[n+1];
hello
[0] = 0;
hello
[1] = 1;
hello
[2] = 2;
hello
[3] = 3;
//hello[4] = 4;
//hello[5] = 5;
Parallel.For(1, n+1, ctr => { B[ctr] = hello[ctr]; });

for(int h =1; h<=3; ++h)
Parallel.For(1, Convert.ToInt32(n/Math.Pow(2,h)), ctr => {
//if (2 * ctr - 1 >= 0 && 2 * ctr <= n)
B
[ctr] = B[2 * ctr - 1] + B[2 * ctr];
//else if(2 * ctr <= n)
// B[ctr] = B[2 * ctr];
});

int sum = B[1];
Console.WriteLine(sum.ToString());




bots


Why sum is not 6 with this parallel algorithm

I ran your code and stepped through it and it seems that this equation "n / Math.Pow(2, h)" will always be less than one


Edit: Except the first iteration the result is 1.5

Why sum is not 6 with this parallel algorithm

<cite style="color:#00802a;font-style:normal;font-size:14px;font-family:arial, sans-serif;white-space:nowrap;">www2.ee.ntu.edu.tw/~yen/courses/al-01/parallel-algorithm.ppt</cite>


i follow above algorithm, anything wrong with it?




---.-----!



Why sum is not 6 with this parallel algorithm

i do not understanding how floating point be used in for loop


here i follow n = 3 = 2^k where 2 > k > 1 result in Math.Log(n)



n = 3;

for(int h =1; h<=Math.Log(n); ++h)





---v-----!


Why sum is not 6 with this parallel algorithm

Hrm, this is a different piece of code and it's obviously wrong. Math.Log(3) is ~1.09. Your loop will execute exactly once and that's different from your original h loop which executed 3 times.


Why sum is not 6 with this parallel algorithm

I has already followed the algorithm exactly in the powerpoint.


what is the correct way for this algorithm?




---v-----!



Why sum is not 6 with this parallel algorithm

"I has already followed the algorithm exactly in the powerpoint"


Erm, I already told in my first post that you did not followed the algorithm exactly. Did you actually read my post?


Why sum is not 6 with this parallel algorithm

i add rounding, still the same, how to fix it?



Convert.ToInt32(Math.Round(n/Math.Pow(2,h),0))





---v-----!


Why sum is not 6 with this parallel algorithm

This particular issue is primarily caused by n not being a power of 2, it's not strictly related to floating point. Even if you use integers you still have this problem because 3 / (1 << 1) is 3 / 2 which gives 1 and what's not what you want.

Why sum is not 6 with this parallel algorithm

What has this new example has to do with the old one? This code just fills the array with some values, it has no particular requirements on the size of the array.

Why sum is not 6 with this parallel algorithm

those calculations are not shown in the for loop... if you step through and run the numbers in a calculator you don't get an exact integer.

Why sum is not 6 with this parallel algorithm

n = 3 = 2^k, to find k which is ln(3) this is the k in for loop, not is using 2^k in for loop


---v-----!