MarkLogic XCC/.Net Library |

# ContentSourceFactory.NewContentSource Method

Return a ContentSource object that will serve as the source of connections using the provided ConnectionProvider instance.

#### Overload List

Return a ContentSource object that will serve as the source of connections using the provided ConnectionProvider instance.

> public static ContentSource NewContentSource(ConnectionProvider,string,string,string);

Return a ContentSource object that will serve as the source of connections to the server on the given host and port, with no default login credentials. Invoking newSession() on the returned ContentSource object, without providing a user name/password, will throw an IllegalStateException.

> public static ContentSource NewContentSource(string,int);

Equivalent to

    newContentSource (host, port, user, password, null)

> public static ContentSource NewContentSource(string,int,string,string);

Return a ContentSource object that will serve as the source of connections to the server on the given host and port, with login credentials of the given user and password. No connections are made at this time. Note that the ContentSource instance returned may be shared with other callers or threads. The implementation may choose to pool and re-use ContentSource objects for a particular host/port/user combination.

> public static ContentSource NewContentSource(string,int,string,string,string);

Return a ContentSource object that will serve as the source of connections to the server specified by the given URI. The format of the URI is:

    xcc://user:password@host:port/contentbase

For example:

    xcc://joe:hush@myserver:8003/production

The contentbase id is optional. If not specified the default database for the XDBC server configuration will be used. The only supported connection scheme is currently "xcc" ("xdbc" is an alias), but others may be added in the future.

> public static ContentSource NewContentSource(Uri);

#### See Also

ContentSourceFactory Class | Marklogic.Xcc Namespace |