![]() |
|
|
|||||||
![]() |
ASP Net - How to set commandTimeout for ObjectDataSource (ASP.NET 2.0)? |
|
|
Thread Tools | Search this Thread |
|
|
#11 |
|
Hi Juan.
> It's simpler to set the Timeout in code : I know that, however as I said I did not write any line of code - everything was autogenerated by DataSet Designer. It would be great if I could change this generated code by setting there timeout. Unfortunately I cannot find this code. Morover I think that every time I change something in my dataset then this code would be generated one more time and my changes would be overridden. Piotrek Piotrek |
|
|
|
|
#12 |
|
Posts: n/a
|
Hey, did you ever figure this out?
I am having the same problem - in the DataSet desginer, I do not see a way to set the CommandTimeout (just the CommandText, CommandType, etc.). Changing the code... well I would lose it on the next auto-generate. And the command variables are private. ARGH. Piotrek wrote: > Hi Juan. > > > It's simpler to set the Timeout in code : > I know that, however as I said I did not write any line of code - > everything was autogenerated by DataSet Designer. It would be great if > I could change this generated code by setting there timeout. > Unfortunately I cannot find this code. Morover I think that every time > I change something in my dataset then this code would be generated one > more time and my changes would be overridden. > > Piotrek usenetlex@yahoo.com |
|
|
|
#13 |
|
Posts: n/a
|
No I didn't. I just wrote my own DAL class instead of that one, which
was generated by DataSet Designer. Piotrek Piotrek |
|
|
|
#14 | |
|
Junior Member
Join Date: Aug 2007
Posts: 1
|
Quote:
Here is your answer: 1. Open your Dataset (lets say MyDataSet.xsd file). 2. Double click on your table adapter (lets say MyTableAdapter) Visual Studio will switch you to MyDataSet.cs file and will generate similar code for you: Code:
3. Now you need to add new property which will help to set command time-out for all commands controller by MyTableAdapter: Code:
4. Open ASPX page where you are using ObjetDataSource (lets say MyObjetDataSource 5. Select MyObjetDataSource, click with right-mouse on it and from menu choose Properties 6. Visual studio will open Properties window for MyObjetDataSource On top of all properties list there is toolbar. Click lightning icon to see all events of MyObjetDataSource. 7. Double click on ObjectCreated event 8. Visual Studio will open source code of ASPX page and will generate event function for you: Code:
9. Create code which will set Command Timeout just after MyDataSource has been created created Code:
Done. Keywords: C#, commandTimeout, ObjectDataSource, DataSet, TableAdapter, Designer, Solution, Code Example, Resolved, www.jocys.com EJocys Last edited by EJocys : 08-03-2007 at 12:55 PM. |
|
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Apr 2008
Posts: 1
|
Hi EJocys,
That approach does not work for me. The "code behind" for my XSD file is XML. In other words, I get as far as this step: 1. Open your Dataset (lets say MyDataSet.xsd file). 2. Double click on your table adapter (lets say MyTableAdapter) Double-clicking my table adapter does nothing. When I right-click and select "View Code" I see only XML. Anyone know what gives? BlahBlahBlah |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Aug 2008
Posts: 1
|
I made it work.
I had the same issue like you ... code view only showing XML junk. Added a new PARTIAL class with namespace matching my TableAdapter. Something like Code:
Then added following to my ObjectDataSource event CAATDataSource_ObjectCreated Code:
And yes I mixed VB and C# .. it's all same to me. amchi |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| viewstate MAC failed in asp.net 2.0 while postback the page | azraffarveen | Software | 0 | 05-12-2009 03:24 PM |
| .NET 2.0 Web Apps / .NET 3.5 ASP.NET Apps - Differences/Similariti | london1919 | MCTS | 1 | 12-08-2008 03:16 PM |
| ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) | msandlana | Software | 0 | 04-25-2008 06:37 AM |
| ASP.NET deadlock | viktoria | Software | 0 | 07-05-2007 02:53 AM |
| ASP.NET 2.0 application does not run in WIN2k3 | johnfraj | Software | 0 | 04-19-2007 08:27 AM |