The account that is being used is setup for an applicaiton by using a sql server
login. The account also has some kind of rights to windows.
Not sure what that means. The URL indicates you are using a SQL Server user to log in.
The application cannot be running with that user because it isn't an OS user. Even if the name is the same it is still a different user.
and/or tell me what you think can be wrong?
What happens when you comment out all of the code that accesses the database?
I wanted ention/ask the following:
1. I did find out that the username and password for both windows and sql server are the same name and value. Basically windows username and password are exactly the same as the sql server login. Could this cause a problem? if so, what would the problem be?
2. Since the value for connecting to the database comes from an app.config file, is there any way to comment out that connection string information and the vale and the application still works? I would think this would be possible if integrated security=true in the app.config file. I would think if integreated security is not set, and a user name and password is supplied, then the sql server login would be true, correct?
I did find out that the username and password for both windows and sql server
are the same name and value
Which doesn't mean anything. There are two users, in two different contexts and thus they have different access abilities.
Since the value for connecting to the database comes from an app.config file, is
there any way to comment out that connection string information and the vale and
the application still works? I would think this would be possible if integrated
security=true in the app.config file
Phrased awkwardly but presumably if you are asking if you can remove the user/pwd from the connection string and user a windows user instead.
If so then yes.
I would think if integreated security is not set, and a user name and password
is supplied, then the sql server login would be true, correct?
I'm having a few issues with my code, i'm following this tutorial http://www.homeandlearn.co.uk/csharp/csharp_s12p6.html Can anyone point me in the right direction. I've included my code below.
The best overloaded method match for'System.Data.SqlClient.SqlDataAdapter.SqlDataAdapter(string, System.Data.SqlClient.SqlConnection)
<pre lang="c#">Argument 2: cannot convert from 'System.Data.SqlServerCe.SqlCeConnection' to 'System.Data.SqlClient.SqlConnection'
publicpartialclass Form1 : Form
public OpenFileDialog dialog = new OpenFileDialog();
privatevoid btn_sel_Click(object sender, EventArgs e)
//dialog.Filter = "*.sdf";
privatevoid btn_close_Click(object sender, EventArgs e)
con = new System.Data.SqlServerCe.SqlCeConnection();
con.ConnectionString = "Data Source=" + dialog.FileName + ""; //opening dialog (selected file)
ds1 = new DataSet();
string sql = "SELECT * From tbl_games";
da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
And you think we can guess what trouble that is? Please show the exact code you are using and what errors you receive. If you look closely at the link I gave you it shows exactly what parameters are required by the constructor. Have you done it correctly?
You're trying to mix and match similarly named classes from System.Data.SqlServerCe and System.Data.SqlClient namespaces. Understand which platform you're targeting and use the appropriate namespace for the platform.