I created a SQL Bulk load adapter as the standard SQL Adapter casts the stream to a string and runs out of memory for large datasets.
While developing the Bulk Load adapter, I need to specify the connection information. I was about to implement a custom interface, I took the lead from Tomas Restrepo’s Null Adapter. I was having some problems because I was developing on a 64bit box, and then discovered this information about implementing the adapter on 64 bit machines.
I thought that there must be an easier way to do this!
There is an undocumented schema annotation that allows to add connection information.
<xs:element name="ConnectionString" type="xs:string"> <xs:annotation> <xs:appinfo> <baf:designer> <baf:displayname _locID="ConnectionStringName">Edit this field in the resource file</baf:displayname> <baf:description _locID="ConnectionStringDesc">Edit this field in the resource file</baf:description> <baf:editor assembly="%BTSROOT%\Microsoft.BizTalk.Adapter.SQLAdmin.dll">Microsoft.BizTalk.Adapter.SQLAdmin.DatalinkUITypeEditor</baf:editor> <baf:converter assembly="%BTSROOT%\Microsoft.BizTalk.Adapter.SQLAdmin.dll">Microsoft.BizTalk.Adapter.SQLAdmin.DatalinkTypeConverter</baf:converter> <baf:category _locID="DatabaseGrp">Edit this field in the resource file</baf:category> </baf:designer> </xs:appinfo> </xs:annotation> </xs:element>
Here is the adapter interface:
Also, I wanted to show the database information, how you have to do it in C# is the following:
OleDbConnection connection = new OleDbConnection(valueOfConnection); if (connection.DataSource.Length != 0) uri.InnerText = "SQL://" + connection.DataSource + "/" + connection.Database; else uri.InnerText = "SQL://" + connection.DataSource + "/";
Which shows the following: