Friday, May 8, 2015

How to use the pre existing sqlite database

How to use the pre existing sqlite database and in my application to modify the database. It would be better if you can answer with sample code.

I am creating a demo application and i manually feeding data using sqlite database. I want to initially load Sqllite database without launching my app. When my app launches it should use the existing sqllite database.


Purushothama V S

[W8.1]Dedicated Localization for windows 8.1 app in C# and XAML not working on Surface Tablets

I have given the dedicated language  changing option on the Windows 8.1 application in XAML and C# for Desktop and Tablet. I used "Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = culture.Name" for assigning any cultural code like "fr-FR". and I defined all the different strings in the corresponding resource files. When I run it on Desktop , its working fine for all the languages. But When I run it on Surface Table, few of the languages are working but most of them are not.It shows the default language even after changing to some other language.I restart the app. But that is also not working.  Please help me out on this issue. Thanks...

[W8.1]Dedicated Localization for windows 8.1 app in C# and XAML not working on Surface Tablets

Hi Thiyam,

>>But When I run it on Surface Table, few of the languages are working but most of them are not

In my experience, if we want to apply a language to the app, this language should be supported in the operating system(Desktop or Surface).

Back to your description, because this was working on Desktop, so could you please provide the detailed system version on Surface? Could you please list some languages which were not working on your Surface?

If you can create a simple sample and share it using OneDrive, it will help us to reproduce your issue.


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.

[W8.1]Dedicated Localization for windows 8.1 app in C# and XAML not working on Surface Tablets

Thank You very much for your reply....

>>the detailed system version on Surface?

The detail information of the surface is

OS: Windows RT 8.1

System Type: 32-bit Operating System,ARM-based processor

>>languages which were not working

French

Finnish

German

>>language which was working

Greek

Default Language of the app: US-English

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

But I have found some work around as while creating the package I have given

Generate app bundle: Never, then it works fine for all the other languages also.

But I don't want to approached in this way as some of the negative points that I saw on some other's post like more memory occupied device and "individually service each architecture ". "Generate app bundle" should be always "If Needed". Could you give me some  solutions by coding modification/addition on the application.

 Application Type:

Windows 8.1 silverlight upgraded from Windows 8 app, C# and XAML.

Thanks in advance.

Regards,

Thiyam Sunny Singh

Credentials from SSRS to SSAS

Hi Swallow,

I'm not 100% sure I understood. You use an account to connect to SSAS, so I think you mean using the option Credentials Stored securely in the report server and using an account to connect it. Then how to you setup the mapping from the user that is accessing to roles?

You have 2 options (names might be slightly different):

Use windows credentials after connecting to data source

Impersonate authenticated user after connectint to data source

What do you do? Do you need Kerberos?

Thank you

I want to automatically activate a feature automatically when I deploy a new wsp solution and and activate wsp. Is this possible.

I want to automatically activate a  all respective wsp feature  automatically when I deploy a new wsp solution at sitecollection  and and activate wsp. Is this possible.

I want to automatically activate a feature automatically when I deploy a new wsp solution and and activate wsp. Is this possible.

Hi

This can be possible if you are deploying through  using visual studio 

http://ift.tt/1H3sqxQ

else you have to write power shell script for the same.

http://ift.tt/1dS12Jy


Rajendra Singh
Walking on water and developing software from a specification are easy if both are frozen
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

I want to automatically activate a feature automatically when I deploy a new wsp solution and and activate wsp. Is this possible.

yes i was looking powershellscript

i know i can write manually specify each feature name or ID and activate .BUt what i am looking is there any why in powershell to activate all features of wsp once i activate wsp

Note: my wsp is sitecollection scope basically its sandbox solution  


I want to automatically activate a feature automatically when I deploy a new wsp solution and and activate wsp. Is this possible.

hi

below is script 

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
 $webs =  get-spsite -webapplication "http://ift.tt/1H3soGd;
 $feature = "YourFeatureName" #this might not be what you expect it to be, best to do get-spfeature | Select displayname
 
  Foreach ($oneweb in $webs)
  {
    write-host $oneweb
    $siteFeature = get-spfeature -site $oneweb | Where {$_.displayname -eq $feature}
    if ($siteFeature -eq $null)
    {
      Write-Host "Activating Site level Features at $oneweb" -foregroundcolor Yellow
      Enable-SPFeature -Identity $Feature -URL $oneweb.URL -Confirm:$False
    }
    else
    {
      Write-Host "Feature $feature is already activated on $oneweb" -foregroundcolor green
    }
  }

You can add multiple feature by adding $feature1,$feature2 like that and you can customized to particular site by 

$webs =  get-spsite  "url of the site collection"

Rajendra Singh
Walking on water and developing software from a specification are easy if both are frozen
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

ParamCount() and ParamStr(1).c_str()

C++

int __fastcall dload ()
{
  int found = 0;
  char msg[255];
  char cmd[255];

  strcpy (cmd,"");//......................................1
  if (ParamCount() > 0)//..............................2
    {
    strcpy (cmd,ParamStr(1).c_str() );//...........3
    found = 1; 
    }

  return found;
}

What s the equivalent to 1,2 and 3.

How to refresh Form1 from inside a class?

Thanks Andy...

I was able to use the constructor as described. I then created a Form variable in my class, then assign it to the constructor Form variable in the constructor. Then in my class procedure  I just did classFormVariable.Refresh(). Everything works good now.

Thanks again,

Tom


How to refresh Form1 from inside a class?

Great stuff.

I only mentioned the messenger thing just in case you knew about passing in the form and that was the issue.

Often difficult to tell what sort of complexity level to pitch at.

Bear in mind though that passing a reference into a constructor is introducing a dependency.

(  No Sh*t Sherlock ! ?   ).

This is often considered a bad idea because of the risk of references between objects keeping something "alive" you really want dead and garbage collected.

When you use that technique with more than 2 layers/clases like say menu > form > class

This can go pear shaped pretty quick.

Just throw that one to the back of your mind for later.


Hope that helps.

Technet articles: Uneventful MVVM; All my Technet Articles

Migrating From MSSQL 2008 to MSSQL 2014

Before migrating to SQL Server 2014, you should run SQL Server 2014 Upgrade Advisor tool on your existing SQL Server 2008 Databases instance. This will make sure if you are good for upgrade, otherwise you have to do make some code/config changes as per the report created by the tool.

There were few things we observed while upgrading from SQL 2008 to SQL 2012 and as these should also stand same for SQL 2014 as well, so please check these:

1. No native Linked Server support to SQL Server 2000

2. Temp #Tables created with negative IDs

3. IDENTITY column value hop (by design, not a bug)

4. SQLNCLI11 for linked server “XYZ” returned message “Requested conversion is not supported”


~manoj | email: http://scr.im/m22g
http://ift.tt/LOIag3
MCCA 2011 | My FB Page


Migrating From MSSQL 2008 to MSSQL 2014

Hello Trex,

Before you migrate your SQL Server you should check all database with the SQL Server 2014 Upgrade Advisor to see if there could be some issues with existing code. There are some breaking changes in SQL Server 2014, e.g. old ANSI join Syntax isn't any longer supported; see SQL Server Backward Compatibility => Discontinued / Breaking Changes.


Olaf Helper

[ Blog] [ Xing] [ MVP]

Migrating From MSSQL 2008 to MSSQL 2014

If you are fine with In place upgrade then it would cause you less trouble. It is easy, fast and doesn't require you to take backup [Though, I would recommend you to take backup]

One of the issue which I had faced was related to reporting server configuration which can be fixed by repairing.

Ensure that,

  • You are migrating to correct edition
  • You have fulfilled all requirement for MSSQL 2014 
  • You have installed related service packs
  • You have ran upgrade adviser before going to upgrade.

That's all I have faced till now while migrating . :) all the best


Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.


My Profile on Microsoft ASP.NET

Migrating From MSSQL 2008 to MSSQL 2014

Some things I can think of, I'm sure others will have more

Before the Upgrade

Post Upgrade

  • Ensure the database owner is correct, it will take the name of the user who performs the restore, you'll probably want to change this
  • Change the compatibility level of the database to 2014 (you'll want to have tested this as part of your prep) ()
  • Update all of the statistics in your database for all databases
  • Run a DBCC CHECKDB WITH DATA_PURITY for all databases
  • Run DBCC UPDATEUSAGE for all databases

Migrating From MSSQL 2008 to MSSQL 2014

Here is what you need to do:

  • Download and install SQL Server Upgrade Advisor for SQL Server 2014 and run it against SQL Server 2008 instance to find out any issues related to migration. 
  • Backup all user databases on your SQL Server 2008 instance
  • Restore them onto new SQL Server 2014 instance. 
  • Migrate logins from SQL Server 2008 to SQL Server 2014
  • Fix orphaned logins in databases
  • Run sp_updatestats against all databases
  • Run DBCC UPDATEUSAGE against all databases
  • Script SQL Server Agent jobs (if any) from SQL Server 2008 instance and run this script on SQL Server 2014 instance to create these jobs

I suggest to read my following article on TechTarget:

Four points to consider for a SQL Server 2014 installation

Regards,

Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)

http://ift.tt/1yDQKBd

Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Migrating From MSSQL 2008 to MSSQL 2014

Some more links to refer. BOL team has documented about breaking changes in SQL Server 2014

Breaking chages to Database engine feature in SQL Server 2014

Discontinues DB functinality in SQl Server 2014

For both inplace and side by side upgrade you MUST run SQl Server 2014 Upgrade advisor and see for any breaking changes it highlights


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

SQL Server is cutting off the result-output running a powershell script

Hi forum,
I hope, it's the right place for my question:
I want to run a powershell script using xp_cmdshell, put the results into a temp table and do some additional stuff.
I'm using:

CREATE TABLE #DrvLetter (
iid int identity(1,1) primary key
,Laufwerk char(500),
)
INSERT INTO #DrvLetter          
EXEC xp_cmdshell 'powershell.exe -noprofile -command "gwmi -Class win32_volume | ft capacity, freespace, caption -a"'
select * from #DrvLetter

SQL server is cutting off the output, what I get is (consider the 3 dots at the end of a line):
  11817447424   8872448000 C:\ProgramFiles\MicrosoftDPM\DPM\Volumes\Replic...                  
Running the script on the powershell console: "gwmi -Class win32_volume | ft capacity, freespace, caption -a" I get the rigth output:

11817447424   8872448000 C:\Program Files\Microsoft DPM\DPM\Volumes\Replica\BR1A.be009.xxxxx.yyy\SqlServerWriter\PROD\XXX_XXX_XXX_OLAP\   
Using: gwmi -Class win32_volume | ft capacity, freespace, caption -a | out-string -width 200
doesn't help...
Am I doing something wrong?
Thanks for your help

Purclot

SQL Server is cutting off the result-output running a powershell script

The output from xp_cmdshell is a table with single column of the type nvarchar(255). Whence any truncation.

A better alternative is to write a CLR stored procedure to run the Powershell script and digest the output. It could return the data as a result set, which you could capture with INSERT-EXEC, or it could insert the data directly into the temp table. (I would pass the name of the temp table as parameter to the stored procedure.)


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

C# Windows application toolstripmenu item not working properly

I am having a windows application written in C# deployed using clickonce in Windows 7 enterprise installed on VDI Framework: .net framework 4 Target Platform : Mixed Platform

The toolstripmenu item is not working properly, once I click the toolstrip menu items some times the application is "Not responding", some times it doesnt open the sub menu.

Any Thoughts?

How to refresh Form1 from inside a class?

I have a class that uses a dialog for user input. After the input, and before the following procedure to use the input, Form1 should refresh, but it doesn't. I have a garbled display for Form1. How can I refresh Form1 just after closing the dialog object?

How to refresh Form1 from inside a class?

hello


try this:

if (dialog == DialogResult.OK) { this.Refresh();
//or
this.Hide(); new Form1().ShowDialog(); }

hope it helps

How to refresh Form1 from inside a class?

Are you updating controls? How you updating it and it doesn't work?

Fouad Roumieh

How to refresh Form1 from inside a class?

@Spiri91

That doesn't work. "this" only gives me the class object for the class I'm in, not the Form1 object.

@Fouad

I'm in a class that uses a dialog for user input. After the dialog closes, the main form doesn't refresh, but just garbled display.

How to refresh Form1 from inside a class?

@Fouad

I'm in a class that uses a dialog for user input. After the dialog closes, the main form doesn't refresh, but just garbled display.

I read that in the first post, but my question was how you updating the Form1 via code from that class and on closing the dialog? can you share that piece of code?

Fouad Roumieh

How to refresh Form1 from inside a class?

You should never make a class depending from its caller without passing that to the constructor. 

Therefore it can be if you have done that: 

(passing "this" from the form)

System.Windows.Form TheCallingClass = (System.Windows.Form)sender;
TheCallingClass.Show
typed in this messages so watch typos or other small mistakes



Success
Cor




How to refresh Form1 from inside a class?

How do I pass "this" from Form1 in the constructor for the class I'm in?

How to refresh Form1 from inside a class?

If you new up Class1 from Form1 you can do:

Class1 MyInstance = new Class1(this);

You need the constructor of Class1 to take a Window:


public Class1 ( Form CallerForm)
{ }

Then you can make that CallerForm ( which is Form1 ) do stuff.

If these are totally disconnected bits of code ( seems a bit unlikely ) you could use this technique:

http://ift.tt/1IUOFIK


Hope that helps.

Technet articles: Uneventful MVVM; All my Technet Articles

How to refresh Form1 from inside a class?

How do I pass "this" from Form1 in the constructor for the class I'm in?

It depends how are you showing your dialog. Here is example solution:

//Main form
    public partial class Form1 : Form
    {
//...
        private void button1_Click(object sender, EventArgs e)
        {
            using(Dialog dlg = new Dialog(this))
            {
                dlg.ShowDialog();
            }
        }
//...
    }


//Dialog form
    public partial class Dialog : Form
    {
        private Form1 form;

        public Dialog(Form1 form)
        {
            InitializeComponent();
            this.form = form;
        }

        private void Dialog_FormClosing(object sender, FormClosingEventArgs e)
        {
            form.Refresh();
        }
    }


How to refresh Form1 from inside a class?

Just in the suggestion of Mr. Zator you can keep the parameterless constructor also, so it doesn't break where it is used, so you have two:

 public Dialog()
        {
            InitializeComponent();
            
        }


Fouad Roumieh

Migrating From MSSQL 2008 to MSSQL 2014

Hi Guys,

I'm a newbie DBA and I know migrating to MSSQL 2008 to MSSQL 2014 will work seemlessly with Backup and Restore.

My question is, are their any considerations I need to list or anyone encounter issues that you can share with me?

Appreciate all that you can share and suggest. :)

Thanks,

Trex

Migrating From MSSQL 2008 to MSSQL 2014

Hi,

1. You can back up the database schema in Sql 2008 and restore them all in Sql 2014.

2. DTS processes working in Sql 2008 must be migrated to SSIS, to work in Sql 2014.

Read

Migration from SQL server 2008 to 2012


Many Thanks & Best Regards, Hua Min


Starting SQL-job from WEB

I want to start an SQL job when some updates have been made on my web-site

Starting SQL-job from WEB

You can call 'sp_start_job' stored procedure to kick job after the update is made:

EXEC dbo.sp_start_job 'job name' ;

http://ift.tt/1IUOFsa


Starting SQL-job from WEB

adding a bit to dave_gona  answer; Just check status of your job before you kick it up !

DECLARE @JobName nvarchar(100) = 'YourJobName'
IF EXISTS(SELECT 1 
                  FROM msdb.dbo.sysjobs J 
                  JOIN msdb.dbo.sysjobactivity A 
                                                        ON A.job_id=J.job_id 
          WHERE J.name=@JobName 
                            AND A.run_requested_date IS NOT NULL 
                AND A.stop_execution_date IS NULL
         )
    PRINT 'The job is running!'
ELSE
    EXEC msdb.dbo.Sp_Start_job @JobName
You can create a stored procedure and pass the job name as a parameter

Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.


My Profile on Microsoft ASP.NET

Starting SQL-job from WEB

I want to start an SQL job when some updates have been made on my web-site

As others suggested, you can use sp_start_job to invoke a job.

But, I would suggest, whether you should really do it synchronously????

If you can convert these job invoke asynchronously, your performance  would be good.  You should think of inserting the values to a table and then process/invoke your job that scheduled every 1 minute(it depends on your requirement) that will pick those data and process. This way, your online (web) application performance would be good and your process rate would higher. Having said, the above suggestion is merely deending on your requirement.


Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
 [Blog]

how to find serial ports in windows 8??

how to find serial ports in windows 8 ?

Need help implementing DataTemplate Selector.

Hi everyone,

I have made a simple RSS Feed app using AppStudio, and as the title suggests, I need some help on implementing DataTemplateSelector.

I want the first and the last items of the feed to use "BigCards" item template, while the others to have the "SmallCards" item template. 

Here is the code for the item template styling:
<!-- BigCard Item -->
    <DataTemplate x:Key="BigCards">
        <Grid Style="{StaticResource BoxGrid}" Margin="0,0,0,10" Height="380">
            <Rectangle Width="900"/>
            <Grid Style="{StaticResource BoxGrid}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="280"/>
                    <RowDefinition Height="220"/>
                </Grid.RowDefinitions>
                <Image Grid.Row="0" Source="{Binding ImageUrl}" Stretch="UniformToFill" Margin="0,4,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                <Grid Grid.Row="1" Height="220" Margin="10,10,10,10">
                    <Grid Height="210">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Style="{StaticResource BoxTitleStyle}" Text="{Binding Title}" MaxLines="2"/>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
    </DataTemplate>

    <!-- ListHorizontalCards Item -->
    <DataTemplate x:Key="SmallCards">
        <Grid Height="120" Margin="0,0,0,10" Style="{StaticResource BoxGrid}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Image Source="{Binding ImageUrl}" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            <Grid Grid.Column="1">
                <Rectangle Width="900" Height="0"/>
                <Grid Margin="16,5,16,5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Style="{StaticResource BoxTitleStyle}" Text="{Binding Title}" MaxLines="2"/>
                    <TextBlock Grid.Row="1" Margin="0,5,0,0" Style="{StaticResource BoxSubtitleStyle}" Text="{Binding Summary}"/>
                </Grid>

            </Grid>
        </Grid>

Here is the .cs of the MainPage:

        //Listim dinamik i artikujve

        public abstract class TemplateSelector : ContentControl
        {
            public abstract DataTemplate SelectTemplate(object item, DependencyObject container);

            protected override void OnContentChanged(object oldContent, object newContent)
            {
                base.OnContentChanged(oldContent, newContent);

                ContentTemplate = SelectTemplate(newContent, this);
            }
        }

        //endof Abstract Class

        public class ArticleTemplateSelector : TemplateSelector
        {
            public DataTemplate BigCards
            {
                get;
                set;
            }

            public DataTemplate SmallCards
            {
                get;
                set;
            }


          public override DataTemplate SelectTemplate(object item, DependencyObject container)
          {
                // Determine which template to return;

                return null;
            }
        }
I would really appreciate if someone could help me on what I should insert in the DataTemplate SelectTemplate class...?
"return null" is there just so the class gets a result as its required, so that is not neccesarily needed there.

Here is the Main Page xaml which as for the moment uses the BigCards template:
 <Hub x:Name="Container" Grid.Row="1" Margin="0,28,0,0" Background="{StaticResource AppBackground}" DataContext="{Binding}" SectionsInViewChanged="OnSectionsInViewChanged">
                    <HubSection x:Name="LajmetSection" Padding="0,-30,20,0" Width="400" DataContext="{Binding MainViewModel.LajmetModel}"
                        d:DataContext="{d:DesignData Source=/Assets/Data/LajmetDataSource.json, Type=vm:LajmetViewModel, IsDesignTimeCreatable=true}"
                        ContentTemplate="{StaticResource BigCards}" IsHeaderInteractive="{Binding HasMoreItems}" />
                </Hub>

Need help implementing DataTemplate Selector.

You'll need to determine if you want the BigCards or the SmallCards template based on the item and then return the appropriate template. How to decide between them is up to the app.

Often a good way to manage the templates is to expose properties for the two templates which the DataTemplateSelector can then return (it looks like you already have those). The properties can be set from Xaml so you don't need to hardcode the actual templates in code-behind.

Set up the ArticleTemplateSelector with the two templates. It can then be set in the control that will use it:

<Page.Resources>
     <local:ArticleTemplateSelector x:Key="articleSelector" LajmetItem="{StaticResource BigCards}" RssItem="{StaticResource SmallCards}" />
</Page.Resources>
And in the code behind choose between the templates based on the item. How to choose is up to the app:
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
   // Determine which template to return;
   if (ShouldUseBigTemplate(item))
   {
       return LajmetItem;
   } 
   else 
   {
       return RssItem;
   }

   return null;
}

Need help implementing DataTemplate Selector.

LajmetItem and RssItem are irrelevant. Sorry for not changing them in the first place. Take a look at the edited post please. And I don't want app to determine which template to use. I want the first and last item to be using BigCards, and the other ones SmallCards.

Kind Regards

Need help in creating Color Combination logic for Matrix report

Hi Everyone,

I have created a matrix report having  "Probability"  in Row and "Impact" in Column  and "Risk ID" in Data Part .

                Now the problem which I am facing is I need to fill matrix with different color value based on combination of Probability and Impact 

I am able to write the expression in "Fill" area of "Risk_ID" text box but the problem is only those text box gets colored which are having Risk-Id value in it like shown below.I want all text box to be colored even if no Risk_Id is there in any text box.


If anyone  has any idea ,please let me know in writing the correct logic so that all text box gets colored even if there is no Risk _Id in it.

Any help will be greatly appreciated

Thanks

Anuj




Need help in creating Color Combination logic for Matrix report

Hi Anuj,

Based on your description, you want to fill the text box background color by risk_id. And you also need to fill the color when no risk_id exists in textbox. Right?

In SQL Server Reporting Service, you could achieve this goal by using Program Flow function in the expression. For example, use the Switch() function. We can apply condition True as logic expression for no value scenario. We have tested your case in our environment. Please refer to the expression in "Fill" tab below:
=Switch(Field!risk_id.Value=1,"Red",Field!risk_id.Value=2,"Teal",Field!risk_id.Value=3,"Yellow",Field!risk_id.Value=4,"Gray",Field!risk_id.Value=5,"Maroon",True,"Aqua")

The result is like below:

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

Regards,
Shrek Li

Need help in creating Color Combination logic for Matrix report

Hi Shrek,

Thanks for your response but your solution will not fulfill our requirements

1)You have made all blank text box color to "Aqua",this is not required. All the blank text box are having different colors.

2)Table is dynamic, its data will increase further and we can',t hardcode the Risk I'd values like you have.For eg Risk I'd value :1  can be at any coordinates like (2,1)  or( 3,3) .Whatever combinations user selects from the application. Value will go in that place.

What our requirement is that colors are fixed for each coordinates for eg It is fixed that at (1,1) =Green, (1,2)= blue,  (1,3)=Red.

And we are getting this color  only when there is Risk _I'd in that text box,when no risk I'd is there ,no colors will come.

Need help in creating Color Combination logic for Matrix report

Hi Anuj,

Thanks for your question.

Could tell me why (1,1) background color is red and if (1,1) background color is red, based on what? In my understanding, if we want to set a text box background color, we need to be based on some conditions. In our code, we set the text box background color based on Risk_Id.

Please tell us some details about your logic.

Regards,
Shrek Li


Need help in creating Color Combination logic for Matrix report

Hi Shrek,

Logic for Color coding is the combination of probability and impac value.

Logic is like If Probability is Low and impact is unlikely then color=Red

                  If Probability is Medium and impact is unlikely then color=Blue

                   If Probability is High and impact is unlikely then color=green

similarly    if probability is Low and impact is Likely then color=dak blue

but when I create expression based on this logic, only those text box gets colored which are having Risk Id value, remaining text box don't get colored.

Thanks

Anuj

Need help in creating Color Combination logic for Matrix report

Hi Anuj,

As we know, we could get the Probability and Impact field value. But we must set the color manually. SQL Server Reporting Service don't konw what color you want to set to the text box. In a expression, if the field value satisfy the condition, the expression will return a result what we set. If the field value don't satisfy any conditions,  the expression will return a fixed result. Please refert to the code below:

=Switch(Fields!probability.Value="High" and Fields!impact.Value="Possible","Red",
Fields!probability.Value="Medium" and Fields!impact.Value="Unlikely","Yellow",
Fields!probability.Value="High" and Fields!impact.Value="Unlikely","Blue",
Fields!probability.Value="Low" and Fields!impact.Value="Unlikely","Gray",
Fields!probability.Value="Medium" and Fields!impact.Value="Likely","Maroon",
True,"Aqua")

Regards,
Shrek Li

Need help in creating Color Combination logic for Matrix report

Hi Shrek,

Thanks a lot.It worked .

I was using If expression that's why only text box with Risk Id values were getting colored.

using switch statement resolved my issue

Credentials from SSRS to SSAS

Hi guys,

One question, in a architecture of 2 servers, 1 with SSAS and 1 with SSRS, how is security taken care, if I set windows authentication?

I mean, is there something that needs to be setup to delegate credentials from SSRS to SSAS?

Thank you

Credentials from SSRS to SSAS

Hi Pedro,

Usually,we use a windows account that is reserved solely as a SSRS service account to control connecting SSRS to SSAS. Then  control access to the cube through permissions in SSRS. I once saw someone use a local machine account since the server doubled as the SSRS and SSAS server, but I personally prefer to secure solely through domain accounts.

More details information:
Roles and Permissions (Analysis Services)

Regards,
Swallow

Thursday, May 7, 2015

excelreaderfactory.cs file not found

C:\Users\test\Documents\Visual Studio 2013......\ExcelDataReader.2.1.2.3\lib\net45\Excel.dll already added to the project when ExcelDataReader installed. But still giving me the same error.

bharathi

excelreaderfactory.cs file not found

hey, yes it is the same case. But how do I catch unhandled excepted for this case.

bharathi

excelreaderfactory.cs file not found

hey, yes it is the same case. But how do I catch unhandled excepted for this case.

bharathi

 public DataTable ExcelToDataTable(string fileName)
        {
            try
            {

                //open a file and returns a stream
                FileStream stream = File.Open(fileName, FileMode.Open, FileAccess.Read);

                //createxmlreader via xmlreaderfactory 
                IExcelDataReader excelreader = ExcelReaderFactory.CreateOpenXmlReader(stream);

                //set the first row as column name

                excelreader.IsFirstRowAsColumnNames = true;

                //return as dataset

                DataSet result = excelreader.AsDataSet();

                //get all the tables

                DataTableCollection table = result.Tables;

                //store it in datatable

                DataTable resulttable = table["sheet1"];
                //return
                return resulttable;
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
            }
        }



Fouad Roumieh

excelreaderfactory.cs file not found

Hello,

Have you looked at the sample below

http://ift.tt/1H3kKhU


Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

excelreaderfactory.cs file not found

hi Fouad..I tried the same code but it is giving me like <xyz>.ExcelToDataTable() not all code paths return a value. how to resolve this.


bharathi

excelreaderfactory.cs file not found

hi Fouad..I tried the same code but it is giving me like <xyz>.ExcelToDataTable() not all code paths return a value. how to resolve this.


bharathi

 catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }



Fouad Roumieh

Object Reference Not set to an Instance of an object

Hi ,

      I created an exe . It contains around 10 forms. When I click back button in a form it will go to form2. For example I wrote

the following code in form4 for going back to form2

           this.Hide();
            Form2 FF = new Form2();
            
            FF.ShowDialog(this.Owner);

But when I run the program on my system, it works fine. After that I installed the exe on another system . In that system when I press the back btton on form4, it will go to form2 but shows the error that "Object Reference Not set to an Instance of an object". How can I solve this problem?? Is any updation needed for my code??

Thank you.

Linq to get data from another list

I think this article here:

http://ift.tt/1IjsCe2

Explains use of join pretty well with an example.

Something like:

var MatchedCategories = from cat in CategoryList
            join itm in ItemList
            on cat.ID equals itm.CategoryID


Hope that helps.

Technet articles: Uneventful MVVM; All my Technet Articles

Linq to get data from another list

Thanks Andy

Table Variables very slow performance

My Dear,

i have a payroll calculation application that should handle many logical details at a very complex various options.

the point is explained as follows:

1- i have a function that calculate a single payroll element and returns its value for a selected month ([Calculate payroll element] Returns Float).

2- i have a function ([calculate employee payroll] return table variable) this is responsible to check what calculations needs to happen for a selected employee and calls first function for each of them.

3- i have a complex procedure that is responsible to show all company payroll as a pivot display, to do that i am:

a- looping using a cursor for each employee and checking many options (like terminated employees or payroll suspended       employees ...)

b- for each employee call the function (2) that should calculate employee payroll and insert the calculation in a temp table.

c- the Pivot functionality of SQL server is not useful as using it will need you to know what are the payroll elements exactly to select them becoming a pivot columns, while my payroll elements are already variable and comes from a table. so i am creating a temp table and opening a cursor on the calculation temp table returned from previous step and making dynamic table altering to add a column for each payroll element.

final result should be like follows: 

Employee  Basic SalaryHousing Accommodation... Dynamic Columns on the bases of table definition

001 3500 1000

002 2600 2000

this process is taking 30 secs on my laptop to calculate 370 employees salary, but taking 3 minutes to calculate same data on my online VPS.

i have made many performance monitoring and invested a lot of time to trace it, and realized that inserting a vartable table result into another table variable result is taking forever, so calling the calculate payroll for each employee (2) is taking a lot of time when it is part of a loop, while calling the same function (1) in a big and fixed select statement is way much faster. i can't depend on the big fixed statment as everything in product is dynamic.

how can i at least make the performance the same Please??

Table Variables very slow performance

Avoid using scalar UDF as they are a performance killer

For large set of the data use a temporary tables rather than a table variable.


Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

Table Variables very slow performance

Could you please post table structure, sample data (DDL, DML)? Have you considered using a temp table with indexes to see if it improves the performance?

web: www.ronnierahman.com

Table Variables very slow performance

We will not be able to help you with the explanation that you provided. We need more details like DDL + DML + your function code + Execution plan and index details etc.

However, here are few points that you can check out:

1. Try to avoid CURSOR based approach and move to SET based approach wherever possible.

2. Try to avoid SCALAR if that causes a performance issues. Use Inline TVF instead.

3. Try to examine the execution plan and see where your execution is taking more time.

4. Try to optimize your query to use indexes and make sure the appropriate insdexes are available.


Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
 [Blog]

Table Variables very slow performance

Actually you are correct,

i need to avoid using UDF as they are a performance killer.

i was planning the process this way as the same functions is used in all other reports for various reasons, and i was thinking in a way like OOP, so i need to centralize my customization if needed to.

Currently if my client wants to change how payroll element is calculated i can update that in one single function, and that will automatically update the entire product reports and screens accordingly.

product has more then 1300 screens and reports, and doing a change is extremely time explosive.

i will replicate my functions involved in process now and will try them as stored procedures with temp tables instead.

i even has made a try to move to SQL 2014 to utilize memory compiled procedures, and memory tables. but it is very limited feature as many options are not possible with new compiled procs.

and wondering whether i should build a DLL using VB.NET in order to do some processing in memory instead of the tempdb utilization.

thanks a lot for your great hep , will post back my testing results.

Table Variables very slow performance

Well , test it and tells us how was it going...

Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

identifie blocking process

hi Guys

imagine i set a begin transaction on table a and updating a row and not committed and not roll backed--first connection

from second connection i am selecting same table(obviously it wait until first connection commits/rollback based on my transaction level:my isolation level is read commited)

1.how do i know second connection is to waiting to first connection to complete

2.if i want to select rows that are not locked by update process how do i need to do(ex:row 1,2,3,4 and 1 is locked by update process(exclusive lock) and i want to leave that and i need to select 2,3,4 records)

Very much thanks in advance


ADKR

identifie blocking process

/*BLOCKING*/
EXEC dbo.sp_WhoIsActive @find_block_leaders =1,
@output_column_list ='[blocked_session_count][blocking_session_id][session_id][CPU][status][wait_info]
                      [database_name][sql_text][host_name][open_tran_count]',
@sort_order='[blocked_session_count]DESC'

Use Adam's great procedure

Who Is Active? v10.00 (2010-10-21)
(C) 2007-2010, Adam Machanic


Updates: http://ift.tt/VRLyoN
"Beta" Builds: http://ift.tt/1IiYsZU

License: 
Who is Active? is free to download and use for personal, educational, and internal 
corporate purposes, provided that this header is preserved. Redistribution or sale 
of Who is Active?, in whole or in part, is prohibited without the author's express 
written consent.

Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

identifie blocking process

i dont get it

ADKR

identifie blocking process

hey i got you code version 11

it says

Warning: The join order has been enforced because a local join hint is used.
Msg 8631, Level 17, State 1, Procedure sp_WhoIsActive, Line 1706
Internal error: Server stack limit has been reached. Please look for potentially deep nesting in your query, and try to simplify it.


ADKR

identifie blocking process

hey v 10 worked fine

but how to decide which one is blocked by which

could you please explain it to me


ADKR

identifie blocking process

Here Adam explains how it works

http://ift.tt/1KO8yQx


Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

Is it okay add html tag in rc file?

I load text from .rc files. Lets say for instance, I have this "MSFT forums"; i'd want to only bold out "MSFT"?

So, I write my string as this "<b>MSFT</b> forums" -- Its not applying the style..Can anyone please help me with this?

thanks!

Linq to get data from another list

I have entities Category and Item. It contains data like this

Category

ID       Name

1   CC01

2   CC02

3   CC03

Item

ID    CategoryId 

1      1 

2      3 

Now I want Category list(List<Category>) which exists in the items. How can I use linq to get this result out of the List<Category> and List<Item>



How do i compare two strings and get the difference?

for example,

1)

s1 ="abc123"

s2 = "123"

strDiff = abc

2)

s1 = "abc123"

s2=""

strDiff = "abc123"


How do i compare two strings and get the difference?

I think you need to explain in detail what you mean by the "difference". For example:

s1 = "abc123"
s2 = "xyz"
strDiff = ??

s1 = "abc123"
s2 = "2ca1"
strDiff = ??

How do i compare two strings and get the difference?

I have explained with an example of what exactly I' am looking for in my previous post. s1, s2 are the two strings to be compared and strDiff is the desired result. How is that not clear? 

I'm comparing INI file key:value pairs. So most of the time the string will be different by just one or two charecters. I want to get the difference in the two strings.

How do i compare two strings and get the difference?

I have explained with an example of what exactly I' am looking for in my previous post. s1, s2 are the two strings to be compared and strDiff is the desired result. How is that not clear? 

I'm comparing INI file key:value pairs. So most of the time the string will be different by just one or two charecters. I want to get the difference in the two strings.

Your two examples don't, for example, show what should happen in either of the two examples that I gave.

Are you trying to delete from s1 every character that occurs in s2? If so does the order of the characters matter? What if a character occurs twice in s1 but only once in s2?

Or do you mean you want to first check that s2 is a substring of s1 (and presumably throw an exception if it is not) and then remove the s2 substring from s1?

I could guess other things from your two examples, that is why I'm asking you to explain what you want.

How do i compare two strings and get the difference?

If I guess that what you want is to check that s2 is a substring of s1, and if so remove the substring from s1, here is some code to do that.

int pos = s1.IndexOf(s2);
if (pos < 0)
{
    throw new InvalidOperationException(s2 + " is not a substring of " + s1);
}
string strDiff = s1.Remove(pos, s2.Length);

How do i compare two strings and get the difference?

I wont encounter the example you gave since i'm comparing values in an INI file. Either one of the string will be empty or they will vary slightly.

for example

1)

s1 = "IgnintionStatus =1"

s2 = "IgnitionStatus = 2"

if i can somehow extract the difference between s1 and s2 which 1,2 that would be great.

example 2)

s1 = " IgnintionStatus =1"

s2= ""

strDiff =  "IgnintionStatus =1"

These are the only two examples i am concerned about, thanks.

How do i compare two strings and get the difference?

Does this mean, there are 3 situations?

  • The key exists only in only one of the files.
  • The key exists in both ini files and the values are equal
  • The key exists in both ini files but the values are different.

I wouldn't compare the line as one string. Instead, separate the key from the value. Then you can simply check these conditions.

If you also want to find similar key names, we still need to find the rules what is similarity and what are differences.


Armin

How do i compare two strings and get the difference?

for example,

1)

s1 ="abc123"

s2 = "123"

strDiff = abc

2)

s1 = "abc123"

s2=""

strDiff = "abc123"


Based on your description, does the following code meet your requirements?

Using Except extension method to help do this, maybe there is a pure Linq way to achieve that.

  string s1 = "abc123 ";
            string s2 = "123";// or null
            char[] ss = s1.Except(s2).ToArray();
            string diff = new string(ss);
            MessageBox.Show(diff);

Best regards,

Kristin


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.

identifie blocking process

hi Guys

imagine i set a begin transaction on table a and updating a row and not committed and not roll backed--first connection

from second connection i am selecting same table(obviously it wait until first connection commits/rollback based on my transaction level:my isolation level is read commited)

1.how do i know second connection is to waiting to first connection to complete

2.if i want to select rows that are not locked by update process how do i need to do(ex:row 1,2,3,4 and 1 is locked by update process(exclusive lock) and i want to leave that and i need to select 2,3,4 records)

Very much thanks in advance


ADKR

identifie blocking process

/*BLOCKING*/
EXEC dbo.sp_WhoIsActive @find_block_leaders =1,
@output_column_list ='[blocked_session_count][blocking_session_id][session_id][CPU][status][wait_info]
                      [database_name][sql_text][host_name][open_tran_count]',
@sort_order='[blocked_session_count]DESC'

Use Adam's great procedure

Who Is Active? v10.00 (2010-10-21)
(C) 2007-2010, Adam Machanic


Updates: http://ift.tt/VRLyoN
"Beta" Builds: http://ift.tt/1IiYsZU

License: 
Who is Active? is free to download and use for personal, educational, and internal 
corporate purposes, provided that this header is preserved. Redistribution or sale 
of Who is Active?, in whole or in part, is prohibited without the author's express 
written consent.

Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

identifie blocking process

i dont get it

ADKR

identifie blocking process

hey i got you code version 11

it says

Warning: The join order has been enforced because a local join hint is used.
Msg 8631, Level 17, State 1, Procedure sp_WhoIsActive, Line 1706
Internal error: Server stack limit has been reached. Please look for potentially deep nesting in your query, and try to simplify it.


ADKR

identifie blocking process

hey v 10 worked fine

but how to decide which one is blocked by which

could you please explain it to me


ADKR

Recursive CTE Work Flow

Hi To all,

Can anyone explain how recursive CTE works

--------------------------------------------
-- Synthesise table with non-recursive CTE
--------------------------------------------
;WITH Employee (ID, Name, MgrID) AS 
(
    SELECT 1,      'Keith',      NULL   UNION ALL
    SELECT 2,      'Josh',       1      UNION ALL
    SELECT 3,      'Robin',      1      UNION ALL
    SELECT 4,      'Raja',       2      UNION ALL
    --SELECT 5,      'Tridip',     NULL   UNION ALL
    SELECT 6,      'Arijit',     5      UNION ALL
    SELECT 7,      'Amit',       5      UNION ALL
    SELECT 8,      'Dev',        6   
)
--------------------------------------------
-- Recursive CTE - Chained to the above CTE
--------------------------------------------
,Hierarchy AS
(
    --  Anchor
    SELECT   ID
            ,Name
            ,MgrID
            ,nLevel = 1
            ,Family = ROW_NUMBER() OVER (ORDER BY Name)
    FROM Employee
    WHERE MgrID IS NULL

    UNION ALL
    --  Recursive query
    SELECT   E.ID
            ,E.Name
            ,E.MgrID
            ,H.nLevel+1
            ,Family
    FROM Employee   E
    JOIN Hierarchy  H ON E.MgrID = H.ID
)
SELECT *
FROM Hierarchy
ORDER BY Family, nLevel

if you can explain me step by step query working process , still i am getting bit confusion.

the first part query will return one row

ID    Name    MgrID   nLevel  Family
1       Keith   NULL    1       1

then this result set using after union all query .

how the level + 1 condition is working ?  and how its return values .


GVRSPK VENI


Recursive CTE Work Flow

You may refer the below link to get a good idea on recursive CTE.

http://ift.tt/1OgJlAq

Check out the explanation in 

Example Code Walkthrough Section in the above link.


Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
 [Blog]

Recursive CTE Work Flow

Some info you can get here

http://ift.tt/1us1XVM


Best Regards,Uri Dimant SQL Server MVP, http://ift.tt/1iQ9JkR

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

Recursive CTE Work Flow

Hi,

Thank you for your quick response.

In this example how the MangerID(16,274,274,285) will comes under 3 of (level1)


GVRSPK VENI


Recursive CTE Work Flow

Hi Latheesh,

Thanks for your referenced link http://ift.tt/1us1XVM

i want to know detailed information of query.

like

SELECT   ID
            ,Name
            ,MgrID
            ,nLevel = 1
            ,Family = ROW_NUMBER() OVER (ORDER BY Name)
    FROM Employee
    WHERE MgrID IS NULL

this will return one row

then

this level+1 will increase the level 1,2,3..

but in this join is for CTE and Table . how the join works here?, because CTE will return only one value but the table has more value of mgrid so please explain me elbroate.


GVRSPK VENI


Drawing lines in canvas using accelerometer sensor data in windows phone 8.1

I am drawing on canvas based on device movement, I want to draw different characters in canvas based on mobile movement.

Currently its working butt i want to find time difference and i want to detect pause , pause means when user is not trying to draw and user is not moving mobile phone , so that Application ca assume that now user want to draw next character, How to find pause in accelerometer values. Any logic ? Also tell me how i can smooth accelerometer values , so that user can draw lines without noise.

Drawing lines in canvas using accelerometer sensor data in windows phone 8.1

How to find pause in accelerometer values. Any logic ?

You asked those work which Motion class has done. The Motion class handles the low-level sensor calculation and allows applications to easily obtain the device’s attitude (yaw, pitch, and roll), rotational acceleration, and linear acceleration both due to gravity and user movement. If you cannot use this class in your app, maybe has no hardware in device, you shall use your favor search engine to find a logic to calculate the x,y,z provided by Accelerometer.

How way to check "SelectionChanged" of listview,... inside hub?

There are listbox and combobox.

Listbox


private async void List_SeletedChanged (object sender, SelectionChangedEventArgs e)
{ var Items = ((ListBox)sender).SelectedItem as ViewModel.CategoryMusic; if(Items!=null) { if (Items.Title != null) { IdAb=Items.IdAlbum;
checkAb=true; } } }
Combobox
private async void Combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                var Items = ((ComboBox)sender).SelectedItem as ViewModel.Geners;
                if (Items != null)
                {
                    if (Items.Id != null)
                    {
                        if (checkAb)
                        {
                            Launch.Source = await ProductComand.GetTopProduct(Items.Id, IdAb);
                        }

<ItemsControl x:Name="LstMu"
Background="Transparent" Foreground="Black"
FontFamily="Segoe WP Light" FontSize="15"
ItemsSource="{Binding Source={StaticResource Launch}" >
All code were laying inside hub.
The first on loading on listbox then It be Ok.Because of Listbox will  take seletedItems valueby default and combobox also take seletecItems value by default

I got a problem is that when I changed "SelectedItem" on listbox then it could not access data  to Launch. I must changed value of combobox on xaml then It could access data to Launch.

I want if no change on combobox but changed on listbox then it could access data to Launch( keep seletedItem on combobox on the first  of app are loading.).

I don't understand this part so I can't explain as clearly.





How way to check "SelectionChanged" of listview,... inside hub?

Hi Greg Heffey,

>>I got a problem is that when I changed "SelectedItem" on listbox then it could not access data  to Launch. I must changed value of combobox on xaml then It could access data to Launch.

I am not sure if I have misunderstood you, in my mind because you have used the following code inside the Combo_SelectionChanged event:

Launch.Source = await ProductComand.GetTopProduct(Items.Id, IdAb);

So if you do not change the value of the ComBobox, then the Combo_SelectionChanged event will not been fired, so this code (Launch.Source = await ProductComand.GetTopProduct(Items.Id, IdAb))will not been executed, then we can not access the data to the Launch.

>>I want if no change on combobox but changed on listbox then it could access data to Launch( keep seletedItem on combobox on the first  of app are loading.).

 If you want to implement the above function, please move this code(Launch.Source = await ProductComand.GetTopProduct(Items.Id, IdAb)) outside of the Combo_SelectionChanged event, for example you can put the code inside the Button Click event. In this way we can execute the Lauch.Source code without changing the SelectedItem of the ComboBox.
If I have misunderstood you, please feel free to let me know.

Best Regards,
Amy Peng

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.




How to display “All Selected” when parameter (Select All) is selected in SSRS?

Using SSRS 2008 r2...I have a report with a single-value parameter and three multi-value parameters, Class1, Name2 and Name3. I'm hoping for an explanation to one thing that I'm seeing and information on a second thing.

Class1 and Name2 both have the (Select All) parameter selected but Class1 is displaying the concatenated parameter variable list whereas Name2 is showing Null. Why is that? If anything, how can I get Class1 to be similar to Name2 and show Null?

But my desired wish is to have Class1, Name2 and Name3 display the text"All Selected" when the parameter (Select All) is chosen. How can this be achieved? Thanks.

How to display “All Selected” when parameter (Select All) is selected in SSRS?

Hi greene303,

Per my understanding that the parameter Name2  is the cascading parameter which depend on the parameter Class1, when you "Select All" of the Class1 the Name2 will show null and you want all the parameters to show "Select All", right?

I have tested on my local environment that if you have specified both the "Available values" and "Default value" for all the parameters, you issue can be caused by some of the fields include the null values, so when you create an multiple values parameter, you can't set to allow null values, this will cause the show null in the parameter.

In your scenario, you can modify the query in the dataset to add text "NULL" and also change the filter to all the filter of both NULL values and not null values.

Details information about how to achieve this for your reference:

  1. For the independent parameter, please modify the query like below to add Text "NULL" in the parameter dropdown list:
    SELECT     distinct  Class1
    FROM       TableName
    where  Class1  is not null
    UNION
    Select '(NULL)'
  2. For all the cascading parameters, please modify the query like below to add Text "NULL" in the parameter :
    SELECT     distinct Name2 
     from TableNamewhere  ISNULL(Class1,'(NULL)')  in (@Class1) and Name2 is not null
    UNION
    Select '(NULL)'
  3. Modify to add the filter in the main dataset's query like below to filter both the null and not null values:
    SELECT  * from case0203
    where ISNULL(Class1,'(NULL)') in (@Class1) and ISNULL(Name2,'(NULL)') in (@Name2)
  4. Preview like below:

More details information:
SSRS: Multi-Value Parameters and NULL values

If you still have any problem, please feel free to ask.

Regards,
Vicky Liu


Vicky Liu
TechNet Community Support


Security question - data source account and folder access

Thank you. I found out that the person that was having access was because she was a domain admin.

Domain admins seem to be able to access SSRS without any security permission.

Powershell script to get a count of lists and libraries in a site collection

Hi,

I need a powershell script to get a count of lists and libraries in a site collection.Please help.I tried this url  http://ift.tt/1ERQiUn but its throwing error like missing  ''>'' in method call.Can u please shre the script.Thanks in advance.

Powershell script to get a count of lists and libraries in a site collection

Hi

see the below thread

http://ift.tt/1ERQiE5

http://ift.tt/1IiYpx6


Rajendra Singh
Walking on water and developing software from a specification are easy if both are frozen
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful


Wednesday, May 6, 2015

Saving Data from Combo-boxes and a List

This works so far but I have two small problems. 

I am trying to call a Form in project A from Project B in the STATThread, but it says It doesn't exist. How do I manage this?

The other error is; "Error 2Metadata file 'C:\Users\God\Desktop\GradedUnit2\Library1\bin\Debug\Library1.exe' could not be foundC:\Users\God\Desktop\GradedUnit2\GradedUnit2\CSCGradedUnit2"

Saving Data from Combo-boxes and a List

This works so far but I have two small problems. 

I am trying to call a Form in project A from Project B in the STATThread, but it says It doesn't exist. How do I manage this?

The other error is; "Error 2Metadata file 'C:\Users\God\Desktop\GradedUnit2\Library1\bin\Debug\Library1.exe' could not be foundC:\Users\God\Desktop\GradedUnit2\GradedUnit2\CSCGradedUnit2"
That seems to have helped although I cannot seem to get it to work yet. 

I set my Main entry of the program in Library1, as above. Yet I try to call the form in my main Project and it is underlinded blue. Library 1 is referenced to the main project but it will not detect the class variable names or launch the Main menu of my program
I think this is a different issue than the main one of the post, please mark the answer of this post and post another question detailing the new issue, we need to keep each post dealing with one issue so other users  can benefit from.

Fouad Roumieh

convert the below stored procedure into query

This is a procedure in my application.

The task of this procedure is when user gives parameter values from front end. It needs to display result accordingly.

Parameters:

For parameters @Site

From front end window he can give only one parameter value from multiple parameter values in drop down list. site column is there in existing table which is filtered by this parameter in query

For parameters @comm_group1, @comm_group2, @productcode, @productfamily

 

He can select a single parameter value or multiple parameter values or if he selects %

In front end window for these parameters, all the values of particular column should be select.

 Like

For @comm_group1, if he selects s05 as parameter value need to display result for this column value only or if he selects s05,s06  need to display result for these values of comm_group1 column or if he selects %, need to display result for all values of comm_group1. Comm_group1 column is there in table. This column is filtered by @comm_group1 parameter value in procedure.

I used comma separated values into rows function

select* from [dbo].[CSVToList]('so5,so6,s07')

in front end, he gives s05,s06,s07 for this parameter

which gives separate row values(s05 one row,s06 another row, s07 another row) like 3 rows here comes

Now I need to convert this stored procedure into query itself for my new application modified version because it won’t support stored procedures or functions.

Give me any suggestions.


USE[CMMS_ENB_REPORTS]

GO

/****** Object:  StoredProcedure [dbo].[USP_ENV_StockChanges]    Script Date: 5/6/2015 12:45:54 PM ******/

SETANSI_NULLS ON

GO

SETQUOTED_IDENTIFIER ON

GO

    /*

--Report Name     : Stock Changes(01.04)

--Created Date  : 2013-11-11 12:00:27.410

--Purpose             : --

--Modified Date :2014-05-14

--Purpose        : Added previous values

 

*/

-- [USP_ENV_StockChanges] 'SLV' ,'%','%' ,'%','%'

-- [USP_ENV_StockChanges] '{Site}' , '{COMM_GROUP_1}','{COMM_GROUP_2}','{Product_code}','{Product_family}'

ALTERproc [dbo].[USP_ENV_StockChanges]

  @site nvarchar(5),

  @comm_group1 nvarchar(10)=null ,

  @comm_group2 nvarchar(10)=null,

  @productcode nvarchar(10)=null,

  @productfamily nvarchar(10)=null

as

 

 if @comm_group1='%'

   set @comm_group1=null

 if @comm_group2='%'

   set @comm_group2=null

 if @productcode='%'

   set @productcode=null

 if @productfamily='%'

   set @productfamily=null

SELECTdistinct [SITE]

      ,[YEAR]

      ,[MONTH]

      ,[PERIOD]

      ,[INVENTORY_UOM]

      ,[PART_NO]

      ,[ACCOUNTING_GROUP]

      ,[ACCOUNTING_GROUP_DESC]

      ,[ASSET_CLASS]

      ,[PRODUCT_CODE]

      ,[PRODUCT_CODE_DESC]

      ,[PRODUCT_FAMILY]

      ,[PRODUCT_FAMILY_DESC]

      ,[COMM_GROUP_1]

      ,[COMM_GROUP_1_DESC]

      ,[COMM_GROUP_2]

      ,[COMM_GROUP_2_DESC]

      ,[QUANTITY]

      ,[TOTAL_INVENTORY_VALUE] [CURRENT_TOTAL_INVENTORY_VALUE]

      ,[TOTAL_INVENTORY_VALUE_$] [CURRENT_TOTAL_INVENTORY_VALUE_$]

             ,[PRE_TOTAL_INVENTORY_VALUE] [PREVIOUS_TOTAL_INVENTORY_VALUE]

      ,[PRE_TOTAL_INVENTORY_VALUE_$] [PREVIOUS_TOTAL_INVENTORY_VALUE_$]

      ,[PART_DESCRIPTION]

   FROM  [dbo].[ENV_StockChanges_V2]

  Where [site] = @site

  and ( COMM_GROUP_1 in (SELECT * FROM dbo.CSVToLIst(@comm_group1))  or @comm_group1 is null )

  and ( COMM_GROUP_2 in (SELECT * FROM dbo.CSVToLIst(@comm_group2))  or @comm_group2 is null)

  and ( PRODUCT_CODE in (SELECT * FROM dbo.CSVToLIst(@productcode))  or @productcode is null)

  and ( PRODUCT_FAMILY in(SELECT * FROM dbo.CSVToLIst(@productfamily))  or @productfamily is null)

  

  order by PERIOD