|
Hi All
I has 2 store : [Paging_Cursor] and [SeriMovyGetAllPaging]
---------[Paging_Cursor] ---------------
GO
ALTER PROCEDURE [dbo].[Paging_Cursor] (
@Tables varchar(1000),
@PK varchar(100),
@Sort varchar(200) = NULL,
@PageNumber int = 1,
@PageSize int = 10,
@Fields varchar(1000) = '*',
@Filter varchar(1000) = NULL,
@Group varchar(1000) = NULL)
AS
/*Find the @PK type*/
DECLARE @PKTable varchar(100)
DECLARE @PKName varchar(100)
DECLARE @type varchar(100)
DECLARE @prec int
IF CHARINDEX('.', @PK) > 0
BEGIN
SET @PKTable = SUBSTRING(@PK, 0, CHARINDEX('.',@PK))
SET @PKName = SUBSTRING(@PK, CHARINDEX('.',@PK) + 1, LEN(@PK))
END
ELSE
BEGIN
SET @PKTable = @Tables
SET @PKName = @PK
END
SELECT @type=t.name, @prec=c.prec
FROM sysobjects o
JOIN syscolumns c on o.id=c.id
JOIN systypes t on c.xusertype=t.xusertype
WHERE o.name = @PKTable AND c.name = @PKName
IF CHARINDEX('char', @type) > 0
SET @type = @type + '(' + CAST(@prec AS varchar) + ')'
DECLARE @strPageSize varchar(50)
DECLARE @strStartRow varchar(50)
DECLARE @strFilter varchar(1000)
DECLARE @strGroup varchar(1000)
/*Default Sorting*/
IF @Sort IS NULL OR @Sort = ''
SET @Sort = @PK
/*Default Page Number*/
IF @PageNumber < 1
SET @PageNumber = 1
/*Set paging variables.*/
SET @strPageSize = CAST(@PageSize AS varchar(50))
SET @strStartRow = CAST(((@PageNumber - 1)*@PageSize + 1) AS varchar(50))
/*Set filter & group variables.*/
IF @Filter IS NOT NULL AND @Filter != ''
SET @strFilter = ' WHERE ' + @Filter + ' '
ELSE
SET @strFilter = ''
IF @Group IS NOT NULL AND @Group != ''
SET @strGroup = ' GROUP BY ' + @Group + ' '
ELSE
SET @strGroup = ''
/*Execute dynamic query*/
EXEC(
'DECLARE @PageSize int
SET @PageSize = ' + @strPageSize + '
DECLARE @PK ' + @type + '
DECLARE @tblPK TABLE (
PK ' + @type + ' NOT NULL PRIMARY KEY
)
DECLARE PagingCursor CURSOR DYNAMIC READ_ONLY FOR
SELECT ' + @PK + ' FROM ' + @Tables + @strFilter + ' ' + @strGroup + ' ORDER BY ' + @Sort + '
OPEN PagingCursor
FETCH RELATIVE ' + @strStartRow + ' FROM PagingCursor INTO @PK
SET NOCOUNT ON
WHILE @PageSize > 0 AND @@FETCH_STATUS = 0
BEGIN
INSERT @tblPK (PK) VALUES (@PK)
FETCH NEXT FROM PagingCursor INTO @PK
SET @PageSize = @PageSize - 1
END
CLOSE PagingCursor
DEALLOCATE PagingCursor
SELECT ' + @Fields + ' FROM ' + @Tables + ' JOIN @tblPK tblPK ON ' + @PK + ' = tblPK.PK ' + @strFilter + ' ' + @strGroup + ' ORDER BY ' + @Sort
)
-------------------------------------
ALTER PROCEDURE [dbo].[SeriMovyGetAllPaging]
@pageNo int
AS
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
exec Paging_Cursor '[dbo].[SeriMovies]
INNER JOIN [dbo].[Country] ON [SeriMovies].[COUNTRYID]=[Country].[COUNTRYID]
INNER JOIN [dbo].[FilmCompany] ON [SeriMovies].[FILMCOMPANYID]=[FilmCompany].[FILMCOMPANYID]',
'SeriMovies.FILMID',
'SeriMovies.FILMID DESC',
@pageNo,
30,
'[SeriMovies].[FILMID],
[SeriMovies].[ENGLISHTITLE],
[SeriMovies].[VIETNAMTITLE],
[SeriMovies].[TOTALSERIAL],
[SeriMovies].[SERIALPRESENT],
[SeriMovies].[MAINPICTURENAME],
[SeriMovies].[SUMMARY],
[SeriMovies].[DESCRIPTION],
[SeriMovies].[FILMCOMPANYID],
[FilmCompany].[NAME] AS COMPANYNAME,
[SeriMovies].[RELEASEYEAR],
[SeriMovies].[COUNTRYID],
[Country].[NAME] AS COUNTRYNAME,
[SeriMovies].[TRAILERURL],
[SeriMovies].[PATHDIRECTORY],
[SeriMovies].[RATEVALUE],
[SeriMovies].[RATECOUNT],
[SeriMovies].[INSERTTIME],
[SeriMovies].[UPDATETIME],
[SeriMovies].[STATUS]',
'[SeriMovies].[STATUS] < 2',
null
- The store SeriMovyGetAllPaging return 30 record
Please help me how to get return System.Data.Linq.ISingleResult<serimovygetallpagingresult> in linq to sql of store SeriMovyGetAllPaging ? .( Now it general return int )
|
|
|
|
|
you have put the question on wrong forum.
cheers,
Abhijit
|
|
|
|
|
Hi, thanks for looking
Im deploying my app to godaddy server and im getting the following error:
Invalid object name 'DB.dbo.ASPStateTempApplications'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'DB.dbo.ASPStateTempApplications'.
The site has been working fine locally
I created the scripts for the DB and excuted them on the server
ASPStateTempApplications as well as ASPStateTempSessions do exist in the server
Everything else seems to be working fine (Im also using asp.net membership)
On godaddy, i have only one user for the DB
Is there anything else tat needs to be done??
Thanks in advance
Alexei Rodriguez
|
|
|
|
|
you can just run aspnet_regsql command for that new data base .
which can again create all tables and SP for membership,profiler
personalization sometimes its creates problem.
cheers,
Abhijit
|
|
|
|
|
I dont have access to that server
sql web admin is all i have
Alexei Rodriguez
|
|
|
|
|
When i created the tables and SPs for SQLServer State, i added them all to the same DB where i have all the tables of the system
EVERYTHING is in the same DB including ASPStateTempApplications and ASPStateTempSessions
In my webconfig, i have the following:
<sessionState mode="SQLServer" timeout="30"
allowCustomSqlDatabase="true"
sqlConnectionString="Data Source=(local)\SQL2005; DataBase=DB; Integrated Security=True">
</sessionState>
Obviously, when i uploaded to remote server, i changed the sqlConnectionString for the correct one
Alexei Rodriguez
|
|
|
|
|
Hi
I was running my application just fine, but when it came to trying to precompile the application, I got an error saying "the type or namespace name 'x' could not be found.
What I have is few pages, and a folder called usercontrols with a few controls(ascx) inside it. What I do is load both controls on a page, and inside the one control I use the FindControl method, and attempt to cast it to the control type (as I said, this was working perfectly during my testing), and then set a few properties of the control.
Now I do the same thing on one of my pages, and it works fine. This is the line of code i use:
usercontrols_ContributionEditorControl contribCtrl = (usercontrols_ContributionEditorControl)Page.FindControl("contributionEditorControl");
Is there a way I can force asp.net to see that I have all these controls in the controls directory? I dont even mind if its possible to turn this warning off (though I would rather get it fixed), but I do need it to work this way. Or is there another way to set the controls properties from within a control?
|
|
|
|
|
I am not sure but I think you need to register the control(contributionEditorControl) to your page.
|
|
|
|
|
Hi, thanks for the advice. I will try this and see what happens - I had registered the controls in the web.config file, but I will try put it onto the page and see what happens.
|
|
|
|
|
Hi,
I m working with an website that has to be be two languages.
First will be english and the other language is arabic, it will have a database too.
Its an ecommerce that that will mostly have products description and other things saved in database.
I wanted to know how to work with it? I mean to say can I use the same database for storing products and usingh a translator or something that will translate the values to the other language or I will have two different set of database each will have their respective language database and will be switching between these database when switching to different language sets.
Thanks
Vijay V.
Yash Softech
|
|
|
|
|
VijayVishwakarma wrote: I wanted to know how to work with it?
There is an article in CP at this link[^]. This can be a good start for you.
VijayVishwakarma wrote: I mean to say can I use the same database for storing products and usingh a translator or something that will translate the values to the other language
Did you even think of what all impacts will be on application, if it has two databases.
Developing software is not just coding but to help your client to accomplish the tasks in a better manner.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I agree that its bad taking two databases but I m confused how to add values that will be coming for user on display.
Say as if I m the webmaster and will add data say some products that will be displayed on the site. how do I get these products for two languages???
thanks
Vijay V.
Yash Softech
|
|
|
|
|
VijayVishwakarma wrote: Say as if I m the webmaster and will add data say some products that will be displayed on the site. how do I get these products for two languages???
Use two columns in a table. Say one for English and another for french.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks...
Vijay V.
Yash Softech
|
|
|
|
|
i have a dropdownlist control in gridview edititemtemplate.
How to get the value of that dropdownlist control from edititemtemplate of the gridview so i can use update query to update selected value in database, when user click the update button in gridview
thanks in advance
|
|
|
|
|
use GridView1.FindControl() Methods.
cheers,
Abhijit
|
|
|
|
|
hi
how can i add/edit/delete/show value from database without page refresh in asp.net using c#.
I will do my best?
|
|
|
|
|
First download and install the ASP.Net Ajax Framework, after that just add an update panel on the page. Now add the controls inside the update panel (like you are creating a regular page). after adding all the controls and code for the controls. just change the Property of the Update Panel by Adding all the click events of all the 3 buttons as Triggers of Update Panel. and its done.
or you can search on google for "ASP.Net using AJAX UpdatePanel". Also there is very nice video tutorial on "ajax.asp.net". I suggest you to watch all the ajax videos on that web site.
|
|
|
|
|
Thanks your suggestion is good for me.
i used update panel and database fill properly but now one problem is create. problem is
i have a gridview in update panel and i set triggers. but i have some imagebuttons in gridview which are working on commandArgument but these are not working properly now? means click on these button nothing happen but without update panel its work properly.
I will do my best?
|
|
|
|
|
|
thanks for reply
as i mention that imagebutton within gridview not work now they clicked when i enter datagrid.itemcommand but not open panel before using update panel open a new panel than work.
I will do my best?
|
|
|
|
|
I want to use a render block inside of an html element in an aspx page,
asp.net,
for example ( <input value="<% varX %>" >;)
xxx
|
|
|
|
|
try this.
varX should be define in codebehiend as public
<input id="test" type="text" value="<%= varx%> />;
cheers,
Abhijit
|
|
|
|
|
Please do like below
]]>.
But it is always better write code in aspx.cs file.
Cheers!!
Brij
|
|
|
|
|
Hi guys,
we have a requirement of calling a web service to update some information in our clients db.
Now everything is working fine, but what if for some reason web service call fails?
call has to be realtime from web app for first time. In case of failure repetitive calls can be using any other service.
thanks
Keep DotNetting!!
GeekFromIndia
|
|
|
|