Query Timeout again....
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Query Timeout again.... Expand / Collapse
Author
Message
Posted 9/28/2009 4:47:36 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/29/2009 10:19:16 AM
Posts: 2, Visits: 11
Hello,
I am creating a reporting application that requires me to connect to a Teradata DW. know on small queries it works great but when it comes to the larger ones is where i have the issues. I know the default is 30 Sec but nothing i do seems to fix the problem.

I have tried the TDcommand.connection timeout but it doesn't seem to like me it say the connection does exist even though i just pull info from it on a small query here is a sample:

Dim ds As System.Data.DataSet = New System.Data.DataSet

Dim OConn As Teradata.Client.Provider.TdConnection = New TdConnection()
Dim da As Teradata.Client.Provider.TdDataAdapter
Dim sql1 As String = "select names from empolyees"

OConn.ConnectionString = "Data Source=Teradatatest.net;User ID=123456;Password=teradata;"
da = New Teradata.Client.Provider.TdDataAdapter(sql1, OConn)
OConn.Open()

Dim cmd As Teradata.Client.Provider.TdCommand = New Teradata.Client.Provider.TdCommand
cmd.CommandTimeout = 0 <- errors here "Connection doesn't exist"

da.Fill(ds)

Me.GridView1.DataSource = ds
Me.GridView1.DataBind()

as you can see above i am running a query against the TDW and filling a DS which i attach to a Gridview so i can make sure its working.

my questions are.

1) what am i doing wrong above?
2) can i set the Teradata connection/query timeout another way? as i would rather create the dataset files in VS gui so i can attached to my control instead of coding everything.

thanks,
Matt
Post #16965
Posted 9/29/2009 2:38:42 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/16/2009 3:03:20 PM
Posts: 152, Visits: 454
TdDataAdapter(String, TdConnection) constructor is used to initialize the DataAdapter. Therefore TdDataAdapter creates an internal TdCommand object and initializes it with the SQL String.

Set the command timeout on TdDataAdapter.SelectCommand property; for example adapter.SelectCommand.CommandTimeout = 900;


--Cal
Post #16984
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 8:12pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.078. 7 queries. Compression Disabled.