|
For sending the parameter to SP,you need to keep in mind very first, that the parameter name should be same in c# as in sp.
For details how to pass to parameter to a sp have a look
One more thing you are passing special characters from C#.It might be creating problem.Just for validation of your code,make a sample POC that doesn't take special characters.
You can also append special characters in SP itself according to your need.
Please let me know when your problem gets resolved.
Cheers!!
Brij
|
|
|
|
|
You haven't set CommandType property of SqlCommand to CommandType.StoredProcedure .
Best wishes,
Navaneeth
|
|
|
|
|
thanks for your reply navneeth,
and i have give the same
..
my code is
SqlCommand Cmd = new SqlCommand();
_Dal.CreateCommand(ref Cmd, "dbo.fao_getpagedproducts");
Cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr;
Cmd.Parameters.Add("@PageSize", SqlDbType.Int, 4).Value = pager1.PageSize;
Cmd.Parameters.Add("@CurrentPage", SqlDbType.Int, 4).Value = pager1.CurrentIndex;
Cmd.Parameters.Add("@Text", SqlDbType.Char, 50).Value = "%"+txtSearch.Text.Trim()+"%";
Cmd.Parameters.Add("@DDLCategory", SqlDbType.Int, 1).Value = Convert.ToInt32(RBCategory.SelectedValue.ToString().Trim()
== "" || RBCategory.SelectedValue.ToString().Trim() == "9" ? "0" : RBCategory.SelectedValue.ToString().Trim());
Cmd.Parameters.Add("@ItemCount", SqlDbType.Int).Direction = ParameterDirection.Output;
dr = Cmd.ExecuteReader();
rptProducts.DataSource = dr;
rptProducts.DataBind();
dr.Close();
here txtSearch is a text box for which i have search
and my procedure is
create PROCEDURE dbo.fao_getpagedproducts(
@Text INT,
)
select * from table where column like @Text
i have shown my simple code
here my text is not working fine..
can you get me wat i m asking for?
|
|
|
|
|
Hema Bairavan wrote: Cmd.Parameters.Add("@Text", SqlDbType.Char, 50).Value = "%"+txtSearch.Text.Trim()+"%";
Hema Bairavan wrote: @Text INT,
I guess the datatype is wrong. Procedure expects and INT and you are passing Char . Try changing the parameter type to Varchar in both places.
Best wishes,
Navaneeth
|
|
|
|
|
extremly sorry navneeth that was char though.
while editing here i missed the text as INT.
i gave that as char only,
and previously i gave varchar in procedure, its not working
when i changed at both the places it works fine
thanks for your support.
and i have also posted new post regarding the ajax controls. if u have time help me though.......
happy new year
|
|
|
|
|
Hi All
I want to add a menu somewhat like that of codeproject(see above the green horizontal div)
Home Articles Quick Answers etc
I was using asp:menu
<asp:menu id="NavigationMenu"
staticdisplaylevels="2"
staticsubmenuindent="10"
orientation="Vertical"
target="_blank"
runat="server" >
<DynamicMenuItemStyle BackColor="Aqua" Font-Bold="true" />
<dynamichoverstyle backcolor="Green"
forecolor="Black"/>
<items>
<asp:menuitem navigateurl="Home.aspx"
text="Home"
tooltip="Home">
<asp:menuitem navigateurl="Music.aspx"
text="Music"
tooltip="Music">
<asp:menuitem navigateurl="Classical.aspx"
text="Classical"
tooltip="Classical"/>
<asp:menuitem navigateurl="Rock.aspx"
text="Rock"
tooltip="Rock"/>
<asp:menuitem navigateurl="Jazz.aspx"
text="Jazz"
tooltip="Jazz"/>
</asp:menuitem>
<asp:menuitem navigateurl="Movies.aspx"
text="Movies"
tooltip="Movies">
<asp:menuitem navigateurl="Action.aspx"
text="Action"
tooltip="Action"/>
<asp:menuitem navigateurl="Drama.aspx"
text="Drama"
tooltip="Drama"/>
<asp:menuitem navigateurl="Musical.aspx"
text="Musical"
tooltip="Musical"/>
</asp:menuitem>
</asp:menuitem>
</items>
</asp:menu>
But I have seen that if I disable javascript on my browser asp:menu doesnot work.
However codeproject menu works even after disabling the javascript.
Please guide which control is the codeproject using for menu.I want to use the same
Thanks
Regards
Sandeep
|
|
|
|
|
I will suggest you to go for CSS Friendly Menu Adapter. That will resolve your issue.
http://www.asp.net/CssAdapters/[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit thanks for your answer
Does the menu on the codeproject site is implemented in the same way?
After disabling the javascript would cssadapters will work?
The codeproject menu works even after disabling javascript on the browser.
Thanks
Regards
Sandeep
|
|
|
|
|
simple CSS fixes will do this..
Say in codeproject the Menu structure is like this :
<ul class="nav" >
<li ><a href="#">Home</a></li>
<ul style="display:none;">
<li ><a href="#">ASP.NET</a></li></ul>
</ul>
Now on
#nav a:hover >ul
{
}
You can apply these sort of simple CSS to show / hide menu items which will not be dependent on Javascript as with Codeproject.
|
|
|
|
|
Thanks Abhishek
Now got the right answer . But please tell me
what the following css code do
#nav a:hover >ul
{
//css to display
}
Thanks
Regards
Sandeep
|
|
|
|
|
This is actually a Combined selector of CSS, means you are going to the first ul under the anchor(a) tag.
Why dont you learn CSS from here :
http://www.w3schools.com/Css/default.asp[^]
I hope this would definitely benefit you while writing CSS menu.
Cheers.
|
|
|
|
|
Hi,
I am trying to customize ClickOnce application for WPF project.
The simple setup works fine but we need automatic updates so we like to use ClickOnce and the requirement is to start application when user logon to his system.
For this requirement we need to create shortcut to user’s startup folder.
Please let me know how to create shortcut to user’s startup folder for ClickOnce.
Thanks
|
|
|
|
|
You are in wrong forum ! This is ASP.NET Forum
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
Hi,
I'm trying to setup my menu links in my master page so that it can be used by all pages irrespective how far down the page hierarchy you are. I haven't done this in ages, I know it is something like:
<a href="<% "~/Product/Default.aspx" %>">Home</a>
Please can someone advise.
Regards,
Brendan
|
|
|
|
|
Why don't you use asp.net menu control.. for details have a look
You can also use normal html links and give look n feel using css as per your need.
Cheers!!
Brij
|
|
|
|
|
I'm not looking to use it as a menu. I have links across that are used over all pages irrespective where you, so menu control will not work. Like for example Contact Us, Terms and Conditions, etc.
How would I do these links?
I can use html links like I showed in my example, but how do I get the href part correct as "../" won't work.
Please can someone advise?
|
|
|
|
|
Hi All
I have a requirement similar to that seen on codeproject website.
I have a requirement which will allow the user to add HTML text in a control(most appropriate Textbox control in multiline mode) and then save it in a file or database.The text will be displayed later when the user visits the page.
And I want to allow only some HTML tags not all.
For eg Codeproject allows the tag for code and pre
And if I write a script alert("Hello world");
tag is ignored in codeproject.
1.How can I achieve this????
And also when we submit the article on codeproject we add the text in textbox control but when our article is published we see our article on a page not in a control(label).
2.How is this achieved??????????
Please provide guidance for the above two requirements
Thanks
The SK
|
|
|
|
|
Use Regular Expression to select from your html the part you want to show and what you dont want to...
Something like this <TAG\b[^>]*>(.*?)</TAG> (there are lot to improve in this expression)
Choose appropriate regex to select the part to omit.
|
|
|
|
|
hello all.
I want to add flash file in the asp.net master page.
how could it be done..
I'm new in flash ...
could anyone tell how to download flash file(*.swf) ?
do anyone know the sites to add some sample flash files ?
|
|
|
|
|
you can emb an swf file in your aspx page like this
<embed src="~/clock.swf" quality="high" wmode="transparent" bgcolor="none" width="125" height="125" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
Cheers!!
Brij
|
|
|
|
|
vinci007 wrote: do anyone know the sites to add some sample flash files ?
Yes. You have to use Object Tag for that . Just few line of Code !
<object width="500" height="500">
<embed src="PATH_TO_YOUR_FILE" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>
If you want a complete go through please read this Article in Code Project
How To Play SWF File In Asp.Net[^]
Hope this is helpful to you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I want the links for the login box coding in C# with the detail expalaination.
Means, what will be the necessary classes for it,database connectivity, etc.
|
|
|
|
|
You can use asp.net membership provider.Please go through the Link for details.
Cheers!!
Brij
|
|
|
|
|