Click here to Skip to main content
15,895,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieving the identity value after insert a row. Pin
aecordoba19-May-08 7:29
aecordoba19-May-08 7:29 
GeneralRe: Retrieving the identity value after insert a row. Pin
SomeGuyThatIsMe19-May-08 7:36
SomeGuyThatIsMe19-May-08 7:36 
GeneralRe: Retrieving the identity value after insert a row. Pin
aecordoba20-May-08 2:18
aecordoba20-May-08 2:18 
GeneralRe: Retrieving the identity value after insert a row. Pin
SomeGuyThatIsMe20-May-08 3:16
SomeGuyThatIsMe20-May-08 3:16 
GeneralRe: Retrieving the identity value after insert a row. Pin
aecordoba21-May-08 1:51
aecordoba21-May-08 1:51 
GeneralRe: Retrieving the identity value after insert a row. Pin
SomeGuyThatIsMe21-May-08 2:09
SomeGuyThatIsMe21-May-08 2:09 
GeneralCrystalReportViewer Toolbox print button event Pin
Kit Fisto19-May-08 6:25
Kit Fisto19-May-08 6:25 
QuestionProblem With '{ }' Pin
Saba0219-May-08 5:48
Saba0219-May-08 5:48 
Hi all,

i used this code,but it has this error:{ expected OR } expected in,i bold place of this error occured ,i tried resolve this errors but i couldn't. D'Oh! | :doh:

 public bool ValidateNewUser(string strAlias, string strFirst, string strLast)
    {

        SqlConnection MyConn = new SqlConnection(ConfigurationSettings.AppSettings["MyOnlineShoppingConnectionString2"]);

        SqlCommand MyCmd = new SqlCommand("sp_CheckForDuplicates", MyConn);

        MyCmd.CommandType = CommandType.StoredProcedure;

        SqlParameter objParam1;
        SqlParameter objParam2;
        SqlParameter objParam3;

        SqlParameter objReturnParam;

        objParam1 = MyCmd.Parameters.Add("@UserName", SqlDbType.VarChar);
        objParam2 = MyCmd.Parameters.Add("@FirstName", SqlDbType.VarChar);
        objParam3 = MyCmd.Parameters.Add("@LastName", SqlDbType.VarChar);
        objReturnParam = MyCmd.Parameters.Add("@Duplicates", SqlDbType.Int);
        objReturnParam.Direction = ParameterDirection.ReturnValue;

        objParam1.Value = strAlias;
        objParam2.Value = strFirst;
        objParam3.Value = strLast;

        try
        {
            if (MyConn.State == ConnectionState.Closed)
            {
                MyConn.Open();
                MyCmd.ExecuteNonQuery();
                
                if (Convert.ToInt32(objReturnParam.Value )> 0)
            {
                lblResult.Text = "UserName already exists or you are already a registered user!";
                return false;
            }
           
            else
            {
                return true;
            } 
                MyConn.Close();
            }
       
        catch (Exception ex)
        {
            lblError.Text = "Error Connecting to Database!";

        }
    } 
    }

Please Help Me,
Thank You, 

<div class="ForumSig">Hoda </div>
<div class="ForumMod">modified on Monday, May 19, 2008 12:00 PM</div>

AnswerRe: Problem With '{ }' Pin
Gareth H19-May-08 6:01
Gareth H19-May-08 6:01 
AnswerRe: Problem With '{ }' Pin
Peter Vertes19-May-08 6:06
Peter Vertes19-May-08 6:06 
AnswerRe: Problem With '{ }' Pin
#realJSOP19-May-08 6:37
mve#realJSOP19-May-08 6:37 
QuestionFile.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 5:10
Ian Uy19-May-08 5:10 
AnswerRe: File.WriteAllBytes and File.ReadAllBytes Pin
User 665819-May-08 5:41
User 665819-May-08 5:41 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 5:43
Ian Uy19-May-08 5:43 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
User 665819-May-08 5:53
User 665819-May-08 5:53 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 5:57
Ian Uy19-May-08 5:57 
AnswerRe: File.WriteAllBytes and File.ReadAllBytes Pin
Adeel Chaudhry19-May-08 5:53
Adeel Chaudhry19-May-08 5:53 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 5:56
Ian Uy19-May-08 5:56 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Adeel Chaudhry19-May-08 8:18
Adeel Chaudhry19-May-08 8:18 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 8:20
Ian Uy19-May-08 8:20 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 20:34
Ian Uy19-May-08 20:34 
AnswerRe: File.WriteAllBytes and File.ReadAllBytes Pin
Guffa19-May-08 9:12
Guffa19-May-08 9:12 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 14:11
Ian Uy19-May-08 14:11 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Guffa19-May-08 19:49
Guffa19-May-08 19:49 
GeneralRe: File.WriteAllBytes and File.ReadAllBytes Pin
Ian Uy19-May-08 20:31
Ian Uy19-May-08 20:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.