Sql Server

Aug 26, 2009 at 7:04 PM

Once again, I am really excited about the FDT, however, I have come across an issue.  This may or may not be serious.

I am building an IFrame fbook app using C#, asp.net.  And when users begin using my app, they are faced with a login screen where they can enter their username and password to pull their data from my DB for my app.  However, I always get a Sql exception error saying that the login failed for the user's fbook username.  Which is weird because that is not the username I am using to login.

Are there any special considerations I need to make when accessing Sql server DB in an iframe fbook app?

Here is the sample of code where it always fails (It fails when it tries to open the connection):

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings[MAIN_DB].ConnectionString);
            SqlCommand cmd = new SqlCommand(); cmd.CommandTimeout = 100;

            cmd.Connection = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = STORED_PROC_NAME;

            SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

            while (dr.Read())
                Result = int.Parse(dr[FIELD_NAME].ToString());
Aug 26, 2009 at 7:48 PM

ooookayyyy....looks like this was a classic oversight.  My connection string was very slightly off.  Literally by two characters.  How crazy.

So problem solved.