Click here to Skip to main content
15,906,285 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Save multiple to XML Pin
l0kke19-May-08 3:24
l0kke19-May-08 3:24 
Questiondirectory delete Pin
RajeevKumarSharma19-May-08 2:31
RajeevKumarSharma19-May-08 2:31 
AnswerRe: directory delete Pin
MHASSANF19-May-08 2:48
MHASSANF19-May-08 2:48 
GeneralRe: directory delete Pin
RajeevKumarSharma19-May-08 2:51
RajeevKumarSharma19-May-08 2:51 
GeneralRe: directory delete Pin
MHASSANF19-May-08 2:54
MHASSANF19-May-08 2:54 
GeneralRe: directory delete Pin
RajeevKumarSharma19-May-08 18:31
RajeevKumarSharma19-May-08 18:31 
GeneralRe: directory delete Pin
Vasudevan Deepak Kumar19-May-08 18:50
Vasudevan Deepak Kumar19-May-08 18:50 
Questionthis error occure in my function:not all code paths return a value Pin
Saba0219-May-08 2:27
Saba0219-May-08 2:27 
Hi all,

this error occure in my function:not all code paths return a value
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!";
}
}

i have two return value but how i can define these for all function?

Thank You,

Hoda

AnswerRe: this error occure in my function:not all code paths return a value Pin
MHASSANF19-May-08 2:32
MHASSANF19-May-08 2:32 
AnswerRe: this error occure in my function:not all code paths return a value Pin
l0kke19-May-08 2:48
l0kke19-May-08 2:48 
QuestionError inserting records into MySql table using Asp 2.0 [modified] Pin
mlingamus19-May-08 2:01
mlingamus19-May-08 2:01 
AnswerRe: Error inserting records into MySql table using Asp 2.0 Pin
doWhileSomething19-May-08 15:10
doWhileSomething19-May-08 15:10 
QuestionFormat the value in report Pin
member2719-May-08 1:44
member2719-May-08 1:44 
QuestionI need ur views to make improvements in the DataBase Interaction file. Pin
Pankaj Garg19-May-08 0:38
Pankaj Garg19-May-08 0:38 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Vasudevan Deepak Kumar19-May-08 0:51
Vasudevan Deepak Kumar19-May-08 0:51 
GeneralRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Pankaj Garg19-May-08 0:55
Pankaj Garg19-May-08 0:55 
GeneralRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Vasudevan Deepak Kumar19-May-08 18:49
Vasudevan Deepak Kumar19-May-08 18:49 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. Pin
N a v a n e e t h19-May-08 1:20
N a v a n e e t h19-May-08 1:20 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. [modified] Pin
J4amieC19-May-08 1:40
J4amieC19-May-08 1:40 
QuestionCompiler Error Message: CS0246: The type or namespace name 'XYZ' could not be found ...... Pin
Aldorado19-May-08 0:20
Aldorado19-May-08 0:20 
QuestionHow to use button control inside ModalPopup Ajax Control Pin
girishdonde18-May-08 23:59
girishdonde18-May-08 23:59 
AnswerRe: How to use button control inside ModalPopup Ajax Control [modified] Pin
Vinay Dornala19-May-08 1:39
Vinay Dornala19-May-08 1:39 
QuestionHow i can resolve this error? Pin
Saba0218-May-08 23:35
Saba0218-May-08 23:35 
AnswerRe: How i can resolve this error? Pin
Saba0218-May-08 23:45
Saba0218-May-08 23:45 
GeneralRe: How i can resolve this error? Pin
Vasudevan Deepak Kumar19-May-08 0:16
Vasudevan Deepak Kumar19-May-08 0:16 

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.