I have a program that takes information passed to it, and puts the information in a database. The program is being created in VS2008 for a Windows Ce 6.0 device, and I am having trouble connecting to the database. I want to connect over the local network, but not entirely too sure how to do so. Here is my code for the function that calls the database.

```
public void callSQL(string partNumber, int total, int numOfPacks, string dunsNumber, string serialNumber, string laneNumber)
{
    //establish connection
    string conString = "Data Source=10.97.2.67,1433;Initial Catalog=testing.mdf;User ID=**********;Persist Security Info=false";

    using (SqlConnection con = new System.Data.SqlClient.SqlConnection(conString))
    {
        con.Open();

        try
        {
            //open the server
            //Insert values passed into the method
            SqlCommand myCommand = new SqlCommand("INSERT INTO test (Part_Number, total, number_of_packs, dunsNumber, serialNumber, truck_number) VALUES (@Part_Number,@total,@number_of_packs,@dunsNumber,@serialNumber,@truck_number)", con);
            myCommand.Parameters.AddWithValue("@Part_Number", partNumber);
            myCommand.Parameters.AddWithValue("@total", total);
            myCommand.Parameters.AddWithValue("@number_of_packs", numOfPacks);
            myCommand.Parameters.AddWithValue("@dunsNumber", dunsNumber);
            myCommand.Parameters.AddWithValue("@serialNumber", serialNumber);
            myCommand.Parameters.AddWithValue("@truck_number", laneNumber);

            //execute the query
            myCommand.ExecuteNonQuery();
            con.Close();
        }
        catch (SqlException e)
        {
           string error = e.ToString();
           error = error.ToLower();

           if (error.Contains("duplicate") == true)
           {
              Console.WriteLine("You have already scanned this barcode.");
           }
        }
    }
}

```

When I run the code, the code stops at con.Open(); and I get an error which says 

> 
> SqlException was unhandled
> 
> 
> 

Here is the information from the error:

> 
> System.Data.SqlClient.SqlException {"SqlException"}  
> 
>  [System.Data.SqlClient.SqlException] {"SqlException"}  
> 
>  {Systen.Data.SqlClient.SqlErrorCOllection}  
> 
>  LineNumber 0  
> 
>  Message "SqlException"  
> 
>  Number 17  
> 
>  Procedure "ConnectionOpen(Connect())."  
> 
>  Server "10.97.2.67,1433"  
> 
>  Source ".Net SqlClient Data Provider"  
> 
>  StackTrace  
> 
>  at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)  
> 
>  at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)  
> 
>  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()  
> 
>  at System.Data.SqlClient.TdsParser.Connect(String host, SqlInternalConnection connHandler, Int32 timeout)  
> 
>  at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()  
> 
>  at System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection connection, Hashtable connectionOptions)  
> 
>  at System.Data.SqlClient.SqlConnection.Open()  
> 
>  at scan.partObject.callSQL(String partNumber, Int32 total, Int32 numOfPacks, String dunsNumber, String serialNumber, String laneNumber)  
> 
>  at scan.Program.Main(String[] args) 
> 
> 
> 

Thanks