I am getting a tad confused as to why I get an error for the code below whereby the second block errors stating invalid object 'transactions'
but if I do this it works?
glb_cnnMM2007 is a global connection variable that is set to my.settings.connectionstring from the main application form on opening.
How come the first block and all other blocks throughout the app accepts it on its own yet the transactions one differs?
The table transactions exists in the database!
VB.NET:
[SIZE=2]taImportData = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter(strSQLString, glb_cnMM2007)
taImportData.Fill(dtImportData)
strSQLString = [/SIZE][SIZE=2][COLOR=#a31515]"SELECT MAX(tran_date) FROM transactions"
[/COLOR][/SIZE][SIZE=2]taTransactions = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter(strSQLString, glb_cnMM2007)[/SIZE]
[SIZE=2][SIZE=2]taTransactions.Fill(dtTransactions)
[/SIZE]
[/SIZE]
but if I do this it works?
VB.NET:
[SIZE=2][SIZE=2]strSQLString = [/SIZE][SIZE=2][COLOR=#a31515]"SELECT MAX(tran_date) FROM transactions"
[/COLOR][/SIZE][SIZE=2]taTransactions = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter(strSQLString, glb_cnMM2007.ConnectionString)
taTransactions.Fill(dtTransactions)
[/SIZE][/SIZE]
glb_cnnMM2007 is a global connection variable that is set to my.settings.connectionstring from the main application form on opening.
How come the first block and all other blocks throughout the app accepts it on its own yet the transactions one differs?
The table transactions exists in the database!