Click or drag to resize

CSQLSRViAttachMDF Method

Attaches an MDF SQL server file to a server.

Namespace:  Geosoft.Desktop.GXNetX
Assembly:  geosoft.desktop.gxnetx (in geosoft.desktop.gxnetx.dll) Version: 2025.1.0.25
Syntax
public static int iAttachMDF(
	CGXNETCore gxNetShared,
	string server,
	string user,
	string password,
	string db,
	string mdf_file_name,
	string ldf_file_name
)

public static int iAttachMDF(
	CGXNETCore gxNetShared,
	string server,
	string user,
	string password,
	string db,
	string mdf_file_name,
	string ldf_file_name
)

Parameters

gxNetShared
Type: GeoEngine.Core.GXNetXCGXNETCore
A shared CGXNETCore
server
Type: SystemString
SQL server to use
user
Type: SystemString
User name (if blank assume NT Integrated Security)
password
Type: SystemString
Password
db
Type: SystemString
DB name
mdf_file_name
Type: SystemString
MDF name
ldf_file_name
Type: SystemString
LDF name (if blank, tries single db attach)

Return Value

Type: Int32
0 - OK 1 - DB Operation Canceled Terminates on Error
Remarks
The file's path need to be visible as local files on the server. Network drives and substitutes may not work.
See Also