|
|
|
Forum 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
|
|
|
|
|
Supreme 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
|
|
|
|