I just created a new clr project, and dropped an SqlConnection component on the form. Edited the connection string and void InitializeComponent(void) looks like this:
void InitializeComponent(void)
{
this->sqlConnection1 = (gcnew System::Data::SqlClient::SqlConnection());
this->SuspendLayout();
this->sqlConnection1->ConnectionString =
L"Data Source=XXXXXX;Initial Catalog=XXXXXX;Integrated Security=True";
this->sqlConnection1->FireInfoMessageEventOnUserErrors = false;
this->AutoScaleDimensions =
System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 262);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
}
You may not be able to see this because of the code folding in visual studio. If this is the case look for small squares containing a '+' on the left side of the editor.
Best regards
Espen Harlinn