Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a TableAdapter

Status
Not open for further replies.

josie2007

Technical User
Apr 14, 2007
90
US
I am trying to create a table adapter using the configuraion wizard and I am trying to select the existing prodedures but it is grayed out and also to create a new procedure also is disabled...any help would be appreciated.
 
Try creating your database access in code, if for no other reason than you'll learn a lot more than trying to drag and drop your way into creating an application.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
thanks Mark for the reply. The only reason that I want to create a DataAdapter is because the only example I found on the web how to create a custom paging is by using TableAdapter wizard . I have done most of the part myself.I created a procedure that returns a certain number of records but I do not have any clue how i can put this together and make it work.
 
There are many examples of paging and the GridView has built in support for doing this. If you wanted to use another control, such as a Repeater, you could use a PagedDataSource like in this example.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Thanks Mark again, I am aware of that but I have over 5000 records and I do not want to use a built in paging for performance reason.Like i said earlier I have a procedure ready to display a certain number of records.MY question is what do i have to do to make this work properly. Do I have to create a class and also use objectdatasource...I would be so appreciate if you give me a guidance what I should do to make this custom paging work.
 
I have the stored procedure like this. What is the next setp that I should take? thanks

PROCEDURE ITEMCUSTOMPAGING(
p_desc in itemlist.idescr%type,
p_letting in bidlet.datelet%type,
p_letting1 in bidlet.datelet%type,
startRowIndex in number ,
maximumRows in number ,
i_results out sys_refcursor
)
AS
BEGIN
OPEN i_results FOR
SELECT *
From (SELECT row_number() over (order by e.eiitem asc) as ItemRank,g.csecnum , e.iplineno , substr(e.eiitem ,1,4)||'.'||substr(e.eiitem ,5,9) ItmeNum,
(i.idescr ||' '|| e.isupdes) Descrip,(i.idescrl ||' '|| e.isupdes) Description, SUM (e.iqty) Quantity , p.cprojnum , p.contid,
DECODE (TRIM (p.prroute), NULL, 'N/A',p.prroute) Route,b.datelet, INITCAP (p.clocat1 || p.clocat2 ) Location ,
p.cdescr ,func_get_unit_name (iunits) Units
FROM itemlist i, estitem e, estcatg g, propproj x, proposal p, bidlet b, letprop l
WHERE p.contid = x.contid AND x.pcn = g.pcn AND e.pcn = g.pcn AND e.cn = g.cn AND i.item = e.eiitem
AND i.ispecyr = p.cspecyr AND e.iplineno <> ' ' AND e.eiitem <> '2550601/01000'
AND e.eiitem <> '2565601/00031' AND e.eiitem <> '2565601/00032' AND e.eiitem <> '2565601/00033'
AND e.eiitem <> '2402601/01000'
AND (i.idescr LIKE TRIM(UPPER(p_desc))||'%' or i.idescrl LIKE TRIM( UPPER(p_desc))||'%')
AND b.datelet between p_letting and p_letting1
AND p.contid = l.lcontid
AND l.letting = b.letting
AND SUBSTR (l.lcontid, 4, 4) <= '5'
GROUP BY g.csecnum,i.idescr,b.datelet,i.iunits,p.clocat1,p.clocat2,p.contid,p.cdescr, p.cprojnum,i.iunits,p.prroute, e.iplineno,e.eiitem, i.idescrl,e.isupdes
)ItemRowNumber
WHERE ItemRank > startRowIndex and ItemRank <= (startRowIndex + maximumRows);
End;
 
If you want to use your own custom paging, you'll have to create forward/next buttons that call the procedure and pass in the necessary parameters that your SP requires. Then, bind your GridView to the results of that call.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Sorry, I might not clear with my question for english is not my native language.What I am trying to do here is that when users use paging I just want to display records only the requested records not the entire records from the database and that is my intention in using the above procedure.I would like to use all the built in functionality as much as i can like built in paging
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top