|
-
Apr 23rd, 2005, 04:40 AM
#1
Thread Starter
Addicted Member
HOw we can pass Optional Parameter and Use of And Operator
public int ExecuteQuery(string strQuery,Optional Boolean bPreparedExecute = False, Optional ByVal lRowsEffected As Int32 = -1, optional Boolean bGetRowsEffetted = False)
==============================
else if (myTable.Rows.Count > rowNum And myTable.Rows(rowNum).RowState = DataRowState.Deleted)
Last edited by Waseemalisyed; May 10th, 2005 at 06:40 AM.
Reason: ok
-
Apr 24th, 2005, 08:23 PM
#2
Re: HOw we can pass Optional Parameter and Use of And Operator
 Originally Posted by Waseemalisyed
public int ExecuteQuery(string strQuery,Optional Boolean bPreparedExecute = False, Optional ByVal lRowsEffected As Int32 = -1, optional Boolean bGetRowsEffetted = False)
==============================
else if (myTable.Rows.Count > rowNum And myTable.Rows(rowNum).RowState = DataRowState.Deleted)
i think that was not c#. 
the vb.net section is in 3rd floor.
-
Apr 25th, 2005, 11:56 AM
#3
Junior Member
Re: HOw we can pass Optional Parameter and Use of And Operator
That definitely wasn't vb.net, but it wasn't c# either. Beats me what it was, actually.
Code:
public int ExecuteQuery(string strQuery,Optional Boolean bPreparedExecute = False, Optional ByVal lRowsEffected As Int32 = -1, optional Boolean bGetRowsEffetted = False)
public int ExecuteQuery(string Query, bool bPreparedExecute, int IRowsEffected, bool bGetRowsEffected)
{
}
There is no such thing as an optional parameter in C#, because optional parameters are essentially just overloads. Instead, make two overloaded functions:
Instead of
Code:
public int FunctionOne(Optional int Parameter, int RegularParameter)
{
}
try this:
Code:
public int FunctionOne(int RegularParameter)
{
}
public int FunctionOne(int Parameter, int RegularParameter)
{
}
==============================
Using and:
Code:
public bool Conditions(Point pt1)
{
bool retVal = false;
if ((pt1.X == 1) && (pt1.Y == 0))
{
}
Return retVal;
}
And is &&. Or is || (double pipes). Bitwise And is &, bitwise Or is |. Good luck,
Dan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|