Hi,
I have a problem with my RadGrid. I have a simple RadGrid that is bound to a StoreProcedure this SP takes 4 arguments all of them can be null.
I have bound the DataScourse Select to 4 controls (4 textboxes). The thought here is that the user will enter values into the textboxes and then he press a "search" button and the grid shows the data that the SP gets.
An example would be that the user inputs
1 in the 1st box
nothing in the 2nd box
3 in the 3rd box
nothing in the 4th box
In this case I want it to run the SP with the values (1,null,3,null)
This is all very simple and when I test it in the "ConfigureDataSource"-tutorial that the RadGrid has and I test the query it all works great, I do the same inputs leave 2 and 4 with nothing and inputs 1 and 3 in the others.
But when I then try this "live" it doesn't work, the grid doesn't even load up and give no records nothing happends.
The only thing that I can think of since I've been working with SP before is that I can't simply use a empty textbox or a null i need to use a DBNull.value otherwise the SP won't work. So how can I send in DBNull.value to the SP?
I've tried some things like
BoxNumber.Text = DBNull.value
(BoxNumber is the name of one of the textboxes), but it still doesn't work.
The "search" button simply does a
RadGrid1.DataBind();
And since its bound to the controls I would hope that a empty control would give null, but it doesn't. It seems like a very simply and small problem yet I have been stuck with it for a long time now, please help me out.
Thanks in advance.
I have a problem with my RadGrid. I have a simple RadGrid that is bound to a StoreProcedure this SP takes 4 arguments all of them can be null.
I have bound the DataScourse Select to 4 controls (4 textboxes). The thought here is that the user will enter values into the textboxes and then he press a "search" button and the grid shows the data that the SP gets.
An example would be that the user inputs
1 in the 1st box
nothing in the 2nd box
3 in the 3rd box
nothing in the 4th box
In this case I want it to run the SP with the values (1,null,3,null)
This is all very simple and when I test it in the "ConfigureDataSource"-tutorial that the RadGrid has and I test the query it all works great, I do the same inputs leave 2 and 4 with nothing and inputs 1 and 3 in the others.
But when I then try this "live" it doesn't work, the grid doesn't even load up and give no records nothing happends.
The only thing that I can think of since I've been working with SP before is that I can't simply use a empty textbox or a null i need to use a DBNull.value otherwise the SP won't work. So how can I send in DBNull.value to the SP?
I've tried some things like
BoxNumber.Text = DBNull.value
(BoxNumber is the name of one of the textboxes), but it still doesn't work.
The "search" button simply does a
RadGrid1.DataBind();
And since its bound to the controls I would hope that a empty control would give null, but it doesn't. It seems like a very simply and small problem yet I have been stuck with it for a long time now, please help me out.
Thanks in advance.