Click here to Skip to main content
15,921,959 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionget serial hard disk asp.net Pin
AnhTin7-Jan-08 15:24
AnhTin7-Jan-08 15:24 
GeneralRe: get serial hard disk asp.net Pin
Christian Graus7-Jan-08 17:10
protectorChristian Graus7-Jan-08 17:10 
GeneralRe: get serial hard disk asp.net Pin
AnhTin7-Jan-08 19:29
AnhTin7-Jan-08 19:29 
GeneralRe: get serial hard disk asp.net Pin
Christian Graus7-Jan-08 20:16
protectorChristian Graus7-Jan-08 20:16 
GeneralRe: get serial hard disk asp.net Pin
Abhijit Jana7-Jan-08 18:36
professionalAbhijit Jana7-Jan-08 18:36 
QuestionHow to Construct full absolute URL from Relative URL ? [modified] Pin
Nadia Monalisa7-Jan-08 9:20
Nadia Monalisa7-Jan-08 9:20 
AnswerRe: How to Construct full absolute URL from Relative URL ? Pin
Michael Sync7-Jan-08 19:15
Michael Sync7-Jan-08 19:15 
GeneralSetting a data source's parameter to null Pin
Fernando A. Gomez F.7-Jan-08 8:47
Fernando A. Gomez F.7-Jan-08 8:47 
Hello all. So I have a SqlDataSource tag in an ASP page. Something like:

<asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="..." 
SelectCommand="selectStoreProcedure" SelectCommandType="StoredProcedure">
<SelectParameters>
 <asp:Parameter Name="Action" Type="String" Size="30"	DefaultValue="GetFilteredEmployeeResources" />	
	<asp:Parameter Name='EmployeeId' Type='String' Size='10'	DefaultValue="%" />
	<asp:Parameter Name='EmployeeName' Type='String' Size='100' DefaultValue="%" />
	<asp:Parameter Name='ResourceId' Type="Int32"/>
</SelectParameters>	
</asp:SqlDataSource>


Now, in my code I use some user input to feed the select parameters, and I have something like:

GridDataSource.SelectParameters["EmployeeId"].DefaultValue = 
    txtIdEmpleado.Text.Length > 0 ? txtIdEmpleado.Text : "%";
...etc...


And then the stored procedure takes care of getting the information needed and filtered. Now, my fourth select parameter is an integer and thus I can't simply do a "like" in the sp's select query. So I made a workaround, and the 'flag' is whether or not this parameter is null.

So the question is: how can I set the parameter (programatically) to null? I tried something like:

GridDataSource.SelectParameters["ResourceId"].DefaultValue = 
    DBNull.Value.ToString();


but it's not working. Any idea on how can I accomplish this task?

Thanks in advance.




Stupidity is an International Association - Enrique Jardiel Poncela

GeneralRe: Setting a data source's parameter to null Pin
Michael Sync7-Jan-08 19:19
Michael Sync7-Jan-08 19:19 
GeneralSimple doubt in google search in HTML Pin
Senthil S7-Jan-08 5:39
Senthil S7-Jan-08 5:39 
GeneralRe: Simple doubt in google search in HTML Pin
Christian Graus7-Jan-08 17:11
protectorChristian Graus7-Jan-08 17:11 
GeneralRe: Simple doubt in google search in HTML Pin
Senthil S7-Jan-08 23:53
Senthil S7-Jan-08 23:53 
GeneralRe: Simple doubt in google search in HTML Pin
Michael Sync7-Jan-08 19:27
Michael Sync7-Jan-08 19:27 
AnswerHai your responce is wat i need Pin
Senthil S8-Jan-08 0:04
Senthil S8-Jan-08 0:04 
Questionasp.net website inside of a php or jsp webpage Pin
Sutorius7-Jan-08 5:19
Sutorius7-Jan-08 5:19 
GeneralRe: asp.net website inside of a php or jsp webpage Pin
Declan Bright7-Jan-08 5:37
Declan Bright7-Jan-08 5:37 
QuestionAdding row to datagrid using Javascript Pin
Nisha S.7-Jan-08 4:40
Nisha S.7-Jan-08 4:40 
GeneralRe: Adding row to datagrid using Javascript Pin
Declan Bright7-Jan-08 5:21
Declan Bright7-Jan-08 5:21 
GeneralFTP command "NLST" gives me "?" instead of "æ", "ø" or "å" Pin
thomasa7-Jan-08 4:33
thomasa7-Jan-08 4:33 
GeneralRe: FTP command "NLST" gives me "?" instead of "æ", "ø" or "å" Pin
thomasa7-Jan-08 5:17
thomasa7-Jan-08 5:17 
Generalcacheprofile doesn't work in control Pin
xcraft7-Jan-08 4:24
professionalxcraft7-Jan-08 4:24 
GeneralASP.Net and Sharepoint Pin
Nathan Gloyn7-Jan-08 3:38
Nathan Gloyn7-Jan-08 3:38 
GeneralDuplicate ID problem Pin
Abhijit Jana7-Jan-08 2:28
professionalAbhijit Jana7-Jan-08 2:28 
GeneralRe: Duplicate ID problem Pin
Michael Sync7-Jan-08 3:47
Michael Sync7-Jan-08 3:47 
GeneralRe: Duplicate ID problem Pin
arivu7-Jan-08 18:00
arivu7-Jan-08 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.