Hi again.
I am using a Data Origin, it's a connection from an Sql server 2005.
I write this code:
foreach (DataConnection conexion in DataConnections)
{
conexion.Name.ToString();
}
and conexion is the DataConnection, made while desiging the template.
While debugging, i look into conexion.
and this is what i see
- conexion {Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost}
Microsoft.Office.InfoPath.DataConnection
{Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost}
- [Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost]
{Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost}
Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost
+ base {Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost}
Microsoft.Office.InfoPath.AdoQueryConnection
{Microsoft.Office.InfoPath.Internal.AdoQueryConnectionHost}
Command "select \"Nombre\",\"Apellido1\",\"Apellido2\",\"Delegacion\" from
\"dbo\".\"PruebasMoss\" as \"PruebasMoss\"" string
Connection "Provider=SQLOLEDB.1;Password=User;Persist Security
Info=True;User ID=User;Initial Catalog=TestDB;Data Source=192.168.2.7;Use
Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation
ID=C3-0002;Use Encryption for Data=False;Tag with column collation when
possible=False" string
Name "PruebasMoss" string
Timeout 30 int
+ Miembros no públicos
Name "PruebasMoss" string
The code i want to change is the Command and the Connection string
Dynamically.
Any idea on how to do it?
Kalyan G Reddy MVP (GGK Tech) said:
Hello
Webservice is one kind of a dataconnection. Which Dataconnection are you
trying to change dynamically?