Friday, April 20, 2012

Set SelectParameter for SqlDataSource SelectCommand with unknown ammount of variables

"



    SelectCommand="SELECT *
FROM Date AS t1 FULL OUTER JOIN (SELECT * FROM WorkHoursEntry WHERE (WorkerID LIKE @WorkerID)) AS t2 ON t1.PKDate = t2.WorkDay
LEFT OUTER JOIN Worker AS t3 ON t2.WorkerID = t3.WorkerID
LEFT OUTER JOIN (SELECT * FROM Project WHERE ProjectID IN(@Project)) AS t4 ON t2.ProjectID = t4.ProjectID"
FilterExpression="YearMonth IN({0})"
>
<FilterParameters>
<asp:ControlParameter ControlID="yearMonthFilterLabel" Name="YearMonth"
PropertyName="Text" Type="String" />
</FilterParameters>
<SelectParameters>
<asp:ControlParameter ControlID="WorkerIDLabel" Name="WorkerID"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="projectFilterLabel" Name="Project"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>


Greetings, I have problem with @Project ControlParameter, problem is I don't know how to pass several values and FilterParameters method won't work as I want. Is there any way to pass several variables ? (without using c#).



projectFilterLabel.Text = 'aaa, bbb, ccc';


Basically what I want to do is to select all values from Date table and join them with some values from Project table and output to DataList.



Any help appreciated, I just started learning asp.net



Thanks.





bind one report with datasat has multipe datatables

I have one Dataset (XSD) with one big data table (represent 2 tables)
I bind this dataset with ReportViewer like this:



        reportViewer1.ProcessingMode = ProcessingMode.Local;
reportViewer1.LocalReport.ReportPath =


"Master_re_Details.rdlc";



       reportViewer1.LocalReport.DataSources.Add(new 


ReportDataSource("DataSet1", this.B_ds.Tables[1]));
reportViewer1.RefreshReport();



        reportViewer1.LocalReport.DataSources.Add(new 


ReportDataSource("DataSet1", this.B_ds.Tables[0]));



        reportViewer1.RefreshReport();


but i get the value from only one datasource only Tables[1] or Tables



[0] but not both of them!
(I guess the first one used)
where is the mistake??





Can .NET website access C drive, add vba macros to ms office and enable Macros Security in Outlook?

This is the scenario:



There's an intranet website that stores a set of macros (Outlook addons). Now I want a user to visit, choose the one they're interested in (Language) and have it installed into their Outlook.



I first need to find the right folder of course, some users still have old images and their Outlook Profile lives in Windows/Microsoft. Some of them use 2003, some 2010 but majority is on 2007.



So the questions are as follows: Can I...




  • use .NET WEBSITE to navigate to user's C:/.. drive ?

  • install new macros ?

  • enable Outlook's Macros security ?





"self" can not detect its properties in Xcode indeed it even doesn't know which class itself is

Hi everyone I have a really strange problem. I create a new subclass of NSObject, but I just cannot use "self.someproperty" in the implementation. Normally when I type the word "self", Xcode will guess what I'm typing and give me the property name after dot. But in this case, it doesn't and give me an red error. I have check my code for a night and give up now. So, wish some one give me a advise please let me know this might be a small problem somewhere?



Here's my code:



#import <Foundation/Foundation.h>

@interface FlickrPhotoCache : NSObject

+(BOOL)isInCache:(NSDictionary *)photo;

@end



#import "FlickrPhotoCache.h"

@interface FlickrPhotoCache()

@property (nonatomic, strong) NSMutableArray *photos;

@end

@implementation FlickrPhotoCache
@synthesize photos = _photos;

+(BOOL)isInCache:(NSDictionary *)photo
{
self.photos // here I get error
}

@end


Thanks in advance! WHT





WPF Datagrid edit only single cell value

I have a WPF Datagrid with 2 columns say parametername and value.



My Requirement is only one value(cell content) for a Particular parametername should be editable and the entire Datagrid contents should be read only....



And I have a save button to save the values.



I had been researching from couple of days for an appropriate solution which observes to be a common requirement in many cases but I havent found...



Please any solution or ideas will be appreciated..



Here is XAML & cs : When the Datagrid loads I want only the PM2 cell value to be in edit mode and all other datagrid content should be greyed out or non-editable..






<Grid>
<DataGrid ItemsSource="{Binding}" AutoGenerateColumns="False"
Margin="20,57,18,19" Name="dataGrid1"
Height="250" SelectionUnit="Cell" >

<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ParameterName}" Width="100" Header="Parameter Name" IsReadOnly="True"/>

<DataGridTextColumn Binding="{Binding Value}" Width="100" Header="Value" />

</DataGrid.Columns>

</DataGrid>
</Grid>





And my CS code



public partial class dgSF : Window
{

ObservableCollection<ParameterSet> pmset;

public dgSF()
{
InitializeComponent();
pmset = new ObservableCollection<ParameterSet>();

pmset.Add(new ParameterSet() { ParameterName = "PM1", Value = 10 });

pmset.Add(new ParameterSet() { ParameterName = "PM2", Value = 50 });

pmset.Add(new ParameterSet() { ParameterName = "PM3", Value = 70 });

pmset.Add(new ParameterSet() { ParameterName = "PM4", Value = 80 });

pmset.Add(new ParameterSet() { ParameterName = "PM5", Value = 100 });

dataGrid1.ItemsSource = pmset;
}
}

public class ParameterSet
{

public string ParameterName { get; set; }

public int Value { get; set; }

}


Thanks So much,



Anu





build multiple shared libraries

Hi I have a java program which has to invoke a native program, and this native program are given by two so files. So I create my so file in order to use this native program APIs to do something for my java program. I was trying to merge two so files with my created so file into single one, and run my java program. However, it seems that it failed this way. To be more concrete, here is my example.



I have a java program A which has to invoke some native code. Therefore I've written some native code and built it as a shared library (called: C.so).



Unfortunately, the native code I've written have to use other code which is in other so files. (A.so, B.so)



Thus, any ideas how to compile my so file with A.so and B.so in order to make my java program work?





TortoiseGit won't let me access my /trunk D:

I have no problem cloning/commiting from my ssh link, but if I ask tortoiseGit to do it on shhLink/trunk i'll get a 128 error.



"fatal: The remote end hung up unexpectedly"



Any idea why?
Thanks.