Click here to Skip to main content
14,325,352 members

Comments by TrushnaK (Top 200 by date)

TrushnaK 10-Oct-14 3:31am View
   
Reason for my vote of 1 \n Not descriptive
TrushnaK 27-Aug-14 5:20am View
   
user Varchar datatype.
TrushnaK 27-Aug-14 5:19am View
   
Do not Repost same question.
TrushnaK 11-Aug-14 8:09am View
   
you are welcome...
TrushnaK 7-Aug-14 7:35am View
   
have you called BindEmployeeGrid() this method on button click ?
TrushnaK 7-Aug-14 2:46am View
   
Welcome...
Mark its as answer if it founds helpful to you.. So others also get the answer.
TrushnaK 6-Aug-14 7:51am View
   
Now check updated answer..
TrushnaK 6-Aug-14 3:36am View
   
Welcome..

If its helpful to you then mark it as answer. So others also gets the help.
TrushnaK 5-Aug-14 9:36am View
   
Do not re post answer rather than improve your previous answer..
TrushnaK 5-Aug-14 9:35am View
   
Check my updated answer..
TrushnaK 5-Aug-14 9:30am View
   
use <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">


instead script manager.
TrushnaK 1-Aug-14 1:35am View
   
improve your question and write down what is your problem.
TrushnaK 31-Jul-14 2:02am View
   
we can't imaging your UI with just css.
TrushnaK 25-Jul-14 3:48am View
   
change database datatype from datetime to date..
TrushnaK 23-Jul-14 9:25am View
   
can you put your javascript code there...
TrushnaK 22-Jul-14 3:59am View
   
you are too late to give answer... Question is asked on 4-Aug-11 23:38pm
TrushnaK 19-Jul-14 1:09am View
   
Thank you Christian...
TrushnaK 18-Jul-14 6:52am View
   
Check you have assigning filtered data in page index changing event..
TrushnaK 23-Jun-14 8:17am View
   
you are late... question was asked on 29-Oct-13 12:53pm
TrushnaK 23-Jun-14 8:06am View
   
Improve your question and post what you want exact...
TrushnaK 16-Jun-14 3:45am View
   
is your id column is auto increamented..
If not then you have to pass value for that (I consider that id column has primary key).
TrushnaK 10-Jun-14 6:29am View
   
from where you call this code.. can you post bit more. that how you call this code
TrushnaK 10-Jun-14 4:38am View
   
so where you have a problem... start coading.
no one here to write down code for you..

try to do something with yourself.If you have problem then come up again.
TrushnaK 7-Jun-14 3:51am View
   
you are late see the question asked on 16-Aug-13.
TrushnaK 7-Jun-14 3:51am View
   
you are late see the question asked on 16-Aug-13.
TrushnaK 2-Jun-14 8:26am View
   
What you want to ask? Improve your question
TrushnaK 2-Jun-14 8:23am View
   
Check your Emp.aspx path. Is that page in same directory.
TrushnaK 2-Jun-14 8:11am View
   
Which column? Improve your question and come back.
TrushnaK 2-Jun-14 5:04am View
   
Thanks for advice.
TrushnaK 31-May-14 3:11am View
   
Use requiredfield validator or do some scripting for validating your textbox.
TrushnaK 31-May-14 3:07am View
   
Go ahead try to develope something. If you have face problem while developing then come back and ask question.
and if you dont know from where you have to start then learn about that.
TrushnaK 30-May-14 3:43am View
   
Is ther any relation between those two tables?
In terms of foreign key..
TrushnaK 29-Mar-14 0:45am View
   
i it is found helpful then mark it as answer...
TrushnaK 28-Mar-14 21:30pm View
   
when you open this question then you found one green button says accept answer. just click on that.
TrushnaK 26-Mar-14 7:29am View
   
try with direct object value
dynamic fn1 =obj["Formatted Name"];
TrushnaK 25-Mar-14 5:37am View
   
Thanks Nirav
TrushnaK 25-Mar-14 5:32am View
   
welcome... mark it as answer if you think it satisfy.
TrushnaK 25-Mar-14 2:46am View
   
it seems that you haven't bind anything in gridview.
take a look a new code.
private void button1_Click(object sender, EventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Credit", typeof(string));
table.Rows.Add(txtName.Text.trim(),txtCredit.Text.trim());
crsView.datasource=table;
}

but this code added columns first time to gridview.
better you create that table structure at loading time then load rows as multiple times in that.
TrushnaK 4-Mar-14 4:52am View
   
check what you get in this line:-
int ipimg = (int)GridView1.DataKeys[e.RowIndex].Value;
TrushnaK 19-Feb-14 3:26am View
   
which type of comparision?
TrushnaK 13-Feb-14 8:05am View
   
try like this:-
<asp:Panel ID="pnl1" runat="server" >
<asp:UpdatePanel ID="updPnl1" runat="server" UpdateMode="Conditional">
<contenttemplate>
//write your all textbox panel code here



and update this panel after you assigning value

string RowValue = Convert.ToString(Session["Value"]);
txtDeptId.Text = RowValue;
updPnl1.Update()

this may be solved your problem. if still its there tell me.
TrushnaK 13-Feb-14 7:42am View
   
ok have you used update panel in you main page (page which have textbox).
TrushnaK 13-Feb-14 7:29am View
   
ya i understood.. bt what is need to open that page in new window..
TrushnaK 13-Feb-14 7:03am View
   
ok sure... give me some time.
TrushnaK 13-Feb-14 6:30am View
   
Deleted
abc
TrushnaK 13-Feb-14 5:27am View
   
it works so what is problem to send to opened window. use same session to assign in opened window.
TrushnaK 13-Feb-14 5:07am View
   
how you fetch dept id and where you assign that id to textbox.. i am asking about that code.
TrushnaK 13-Feb-14 4:55am View
   
can you show your code... what you have done.
TrushnaK 13-Feb-14 4:39am View
   
now try this... cell click event.
TrushnaK 13-Feb-14 0:08am View
   
which logic you executing on single checkbox click and what you want to achieve on multiple checkbox selection..... improve your question with details and some code.
TrushnaK 12-Feb-14 5:35am View
   
which fields you have taken in database for user role..
TrushnaK 10-Feb-14 4:54am View
   
post your code...
TrushnaK 10-Feb-14 4:44am View
   
have you selected your database in query window like..
use product
then write
select * from table where productid in('1','2')
TrushnaK 9-Feb-14 23:54pm View
   
welcome romeland...
TrushnaK 3-Feb-14 4:45am View
   
post your code..
TrushnaK 3-Feb-14 0:08am View
   
can you post your code.. what you have tried. or what is your exact scenario with details.
TrushnaK 31-Jan-14 6:08am View
   
where you set variable a.
is it global
TrushnaK 31-Jan-14 5:11am View
   
post your code..
TrushnaK 31-Jan-14 3:34am View
   
which date you enter in textbox.. and what type of output you want.
TrushnaK 30-Jan-14 5:35am View
   
friend check what you get in
DateTime dt = Convert.ToDateTime(test.Row[4].ToString());
this line.. change your index test.Row[4].ToString().
and try....

or use DateTime.ParseExact() method for converting string to datetime..
TrushnaK 30-Jan-14 3:11am View
   
change this line
DateTime dt = (DateTime) test.Row[4].ToString();
to
DateTime dt = Convert.ToDateTime(test.Row[4].ToString());
TrushnaK 30-Jan-14 2:45am View
   
try this:-
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView test = (System.Data.DataRowView)e.Row.DataItem;
DateTime dt = (DateTime) test.Row[4].ToString(); //Add your date column index here
int dtrslt = DateTime.Compare(dt, Date.Now);
if ( dtrslt < 0)
e.Row.BackColor = System.Drawing.Color.Red;
//Or for hex color
e.Row.BackColor = ColorTranslator.FromHtml("#D1ECC2");
else
e.Row.BackColor = System.Drawing.Color.yellow;
//Or for hex color
e.Row.BackColor = ColorTranslator.FromHtml("#E7B3B3")
}
}
TrushnaK 30-Jan-14 2:30am View
   
nice ans my 5+..
TrushnaK 30-Jan-14 0:09am View
   
thanks Jas24...
TrushnaK 29-Jan-14 8:15am View
   
what you want exactly?
improve your question
TrushnaK 29-Jan-14 7:56am View
   
post your code what you done so far..
TrushnaK 29-Jan-14 2:28am View
   
you want exact answers..
don't you want to take any efforts yourself..

Dim row As GridViewRow = DirectCast(DirectCast(e.CommandSource, Control).NamingContainer, GridViewRow)
Dim str As String = row.Cells(1).Text

this two lines solves your problem..
TrushnaK 29-Jan-14 0:24am View
   
why it is downvoted... any reason.
TrushnaK 26-Jan-14 23:57pm View
   
Thanks karthik...
TrushnaK 25-Jan-14 2:42am View
   
i have updated my answer check it..
TrushnaK 24-Jan-14 23:57pm View
   
exactly... 5+
TrushnaK 24-Jan-14 5:04am View
   
thanks karthik..
TrushnaK 24-Jan-14 5:01am View
   
what you want exactly?
TrushnaK 15-Jan-14 7:42am View
   
have you used fileupload in updatepanel.
TrushnaK 15-Jan-14 7:38am View
   
you are too late... question asked on 23-Jun-12 1:52am.
TrushnaK 15-Jan-14 6:45am View
   
welcome...
TrushnaK 15-Jan-14 0:39am View
   
post your code what you have tried.
TrushnaK 15-Jan-14 0:15am View
   
good one...
my 5
TrushnaK 14-Jan-14 6:30am View
   
hi gitanjali again "Windows hijri calendar". he ask about asp.net
improve your question for keep away from downvoting.
TrushnaK 14-Jan-14 6:26am View
   
"how do i go" for what?
what you want exactly...
TrushnaK 14-Jan-14 0:19am View
   
hi gitanjali he not asking about windows forms..
see the tag and read question again.
improve your answer to keep away for downvoting.
TrushnaK 13-Jan-14 23:56pm View
   
Thanks Karthik....
TrushnaK 13-Jan-14 23:56pm View
   
@ Computer wiz99:- learn jQuery introduction and how to use jQuery with ASP.NET Master page and simple pages from this link. its simple
http://www.codeproject.com/Tips/471799/jQuery-introduction-and-how-to-use-jQuery-with-ASP

once you added the jquery in aspx page then call that alert box as you called.
TrushnaK 10-Jan-14 8:29am View
   
which code?
TrushnaK 10-Jan-14 8:18am View
   
can you more clerify what you want exactly.
TrushnaK 10-Jan-14 6:55am View
   
and question is?
TrushnaK 10-Jan-14 6:52am View
   
this regular expression can not add "." at single time.
he wants to add the "." at single time only.

But i want only single dot in the textbox. Currently user can enter multiple dot.
TrushnaK 10-Jan-14 6:50am View
   
he wants to allow at least single time.
TrushnaK 10-Jan-14 5:12am View
   
add ajax control reference in your project.
TrushnaK 10-Jan-14 1:58am View
   
We are not here to doing your task.
TrushnaK 10-Jan-14 1:17am View
   
we are not clear.
you want css class which hides all new textareas...
TrushnaK 10-Jan-14 0:58am View
   
thanx karthik.... ;)
TrushnaK 10-Jan-14 0:57am View
   
thanx for point out...
i have updated my answer.
TrushnaK 10-Jan-14 0:40am View
   
nice option....
my 5+
TrushnaK 10-Jan-14 0:32am View
   
hi ahemd..
as i given example i demonstrate that if you have value "10" as integer then you can convert to integer using convert.ToInt16 or convert.ToInt32 or int.Tryparse etc..
think that you try to convert "DK" to integer.
either change datatype of CurrencyID to string if it not required in integer or supply integer value as string through (profileList[i].CurrencyID).
TrushnaK 10-Jan-14 0:23am View
   
can you tell me data type of CurrencyID in boatProfile..
TrushnaK 10-Jan-14 0:02am View
   
debug and check what you get in (profileList[i].CurrencyID) .
TrushnaK 9-Jan-14 23:46pm View
   
hi gitanjali...
he ask about datagridview not gridview.
DataGridView control is a winforms control, while GridView is a web control.
TrushnaK 9-Jan-14 6:02am View
   
what you want exactly windows or web?
check your question and improve..
TrushnaK 9-Jan-14 3:14am View
   
improve your question and add your table structure with primary key...
TrushnaK 9-Jan-14 3:01am View
   
Deleted
there are 9 parameters see again...
TrushnaK 9-Jan-14 2:47am View
   
Welcome... mark it as answer if it is helpful to you.
TrushnaK 9-Jan-14 2:27am View
   
Improve your question and add how you pass values to this function.
TrushnaK 8-Jan-14 8:12am View
   
improve your question and post your table structure and post what you want exactly.
TrushnaK 8-Jan-14 7:36am View
   
where you trying to upload file... database or in folder directory,
TrushnaK 8-Jan-14 7:31am View
   
Thanks Karthik....
TrushnaK 8-Jan-14 7:31am View
   
thanks muhhamad riyaaz....
TrushnaK 8-Jan-14 6:15am View
   
have you added meta tags in your site...
if you added then your description approximate matches with meta tags.
you can also write different blogs about your site and that blog's have your website links. Then share that blogs on social sites or your circle.
TrushnaK 3-Jan-14 5:41am View
   
thanks Maciej.....
TrushnaK 3-Jan-14 0:44am View
   
right....
TrushnaK 2-Jan-14 6:04am View
   
detail answer... nice
TrushnaK 2-Jan-14 5:45am View
   
what is your question?
TrushnaK 31-Dec-13 5:57am View
   
nice answer...
TrushnaK 30-Dec-13 7:35am View
   
nice answer....
my 5
TrushnaK 30-Dec-13 7:18am View
   
what you want to do exactly.
TrushnaK 27-Dec-13 7:55am View
   
post your code what you done after search and page index changing.
TrushnaK 27-Dec-13 0:36am View
   
are you want to assign session value to any controls in test2.aspx page ?
TrushnaK 27-Dec-13 0:06am View
   
how to count no of radio buttons which are selected in c#?
improve your question what you want exactly.
TrushnaK 27-Dec-13 0:01am View
   
improve your question and provide more information...
TrushnaK 24-Dec-13 6:16am View
   
what you have done copy- paste
at least change variable name and textbox name...
TrushnaK 24-Dec-13 3:09am View
   
thanx Billwoodruff
TrushnaK 24-Dec-13 2:15am View
   
my 5+
TrushnaK 24-Dec-13 2:13am View
   
code error code error
what is this?
follow link and check how to ask question.
http://www.codeproject.com/Messages/2922875/HOW-TO-ASK-A-QUESTION.aspx
TrushnaK 23-Dec-13 5:29am View
   
which problem you faceing.
TrushnaK 23-Dec-13 3:18am View
   
welcome.
TrushnaK 20-Dec-13 7:31am View
   
you can't focus on two control at the same time.
TrushnaK 20-Dec-13 7:30am View
   
information is not enough. add more information what you want exactly.
TrushnaK 20-Dec-13 7:18am View
   
nice My 5+
TrushnaK 20-Dec-13 5:37am View
   
on which line you get this error.
TrushnaK 20-Dec-13 5:03am View
   
see this example
username points
sam 1000
suthish 2000
kitan 1500
pankaj 4000
this table have 10000 record and i want this result

sam suthish kitan pankaj
1000 2000 1500 4000

then how many subqueries you have.
TrushnaK 20-Dec-13 3:19am View
   
suppose i have table like this:-
empid wagecode amount
1 basic 1000
1 TA 500
1 DA 500
2 Basic 1500
2 TA 750
2 DA 750

and i want result like this
empid basic TA DA
1 1000 500 500
2 1500 750 750

which is wagecode as column
how could you do that using union.

for this you required pivot. eg.
SELECT empid , [Basic], [TA],[DA]
FROM (
SELECT empid, wage, amount
FROM yourtable) up
PIVOT (SUM(amount) FOR wage IN (basic, ta,da)) AS pvt
ORDER BY empid
GO

or for reference visit this link:-
http://www.codeproject.com/Tips/500811/Simple-Way-To-Use-Pivot-In-SQL-Query
TrushnaK 20-Dec-13 0:20am View
   
are you think it is right answer.
TrushnaK 19-Dec-13 0:47am View
   
you have to clear your requirements while asking question.
and the answers is not complicated that are links you have to read that and develope what you want.
TrushnaK 18-Dec-13 3:29am View
   
Help regarding what?
what you have tried yet?
TrushnaK 18-Dec-13 0:11am View
   
where is your condition
price is >1000 & Book having more than one Author.
TrushnaK 17-Dec-13 8:02am View
   
i have updated ans plz check.
TrushnaK 17-Dec-13 7:03am View
   
Which error you get?
TrushnaK 17-Dec-13 5:04am View
   
post your code what you done so far.
TrushnaK 12-Dec-13 5:05am View
   
use gridview events for insert,update,delete.
like row_editing,row_cancelling etc...
TrushnaK 12-Dec-13 4:47am View
   
So what is your question?
TrushnaK 12-Dec-13 3:07am View
   
I hope you have write your code in page_load() event
and check is postback
protected void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack) {
//Bind your grid view and ddl
}
}
TrushnaK 12-Dec-13 0:40am View
   
ya that is problem
what you want to do in foreach loop.
TrushnaK 11-Dec-13 8:24am View
   
Nice answer ^ 5
TrushnaK 11-Dec-13 6:10am View
   
Deleted
What you want exactly?
TrushnaK 11-Dec-13 6:10am View
   
what you want exactly?
TrushnaK 9-Dec-13 8:37am View
   
post your code and senario what you want.
TrushnaK 6-Dec-13 5:05am View
   
you are welcome...
TrushnaK 5-Dec-13 0:49am View
   
post,what you have done so far?
TrushnaK 29-Nov-13 8:14am View
   
Change
var regId = document.getElementById('Label1').innertext;
to
var regId = document.getElementById('Label1').textContent;
it will work fine
TrushnaK 29-Nov-13 6:32am View
   
how it dosent work for you.
i have tested it gives result like http://localhost:4093/WebSite9/AddM.aspx?Id=12313322. in url
TrushnaK 29-Nov-13 4:40am View
   
see your label declaration. <asp:Label ID="Label1" runat="server" Text="Label">
and see my label declaration. <asp:Label ID="Label1" runat="server" Text="12313322" Visible="true" />.
TrushnaK 29-Nov-13 4:40am View
   
Deleted
see your label declaration. <asp:Label ID="Label1" runat="server" Text="Label">
and see my label declaration. <asp:Label ID="Label1" runat="server" Text="12313322" Visible="true" />.
TrushnaK 29-Nov-13 2:00am View
   
you havent pass value to javascript Demand(regid) through onclientclick='Demand()'.
TrushnaK 29-Nov-13 1:45am View
   
i am not asking about values. check is there any connection establish when you requesting for log in.
may be your database is not accessible when you request.
TrushnaK 29-Nov-13 0:53am View
   
have you check your database server which has log in table available.
debug your code and check whether the server available or not.
TrushnaK 28-Nov-13 6:36am View
   
Information is not enough. improve your question what you want exactly.
TrushnaK 18-Nov-13 5:02am View
   
Not clear what you want to do exactly?
How To change url in asp .net of all pages Means.
you want to give www.websitename.com kind address
TrushnaK 18-Nov-13 4:55am View
   
improve your question and post what you did so far.
TrushnaK 18-Nov-13 4:54am View
   
So, Write down program. If you have any error or bug then ask.
tried out yourself.
TrushnaK 14-Nov-13 0:37am View
   
are you trying to assigning the resulted value to be convert in date time.
TrushnaK 12-Nov-13 5:21am View
   
write your query with group by clause with groupNumber column. Then assign result to gridview.
TrushnaK 30-Oct-13 7:41am View
   
Which browser you using?
TrushnaK 30-Oct-13 7:17am View
   
have you register your ajax control toolkit ?
TrushnaK 29-Oct-13 9:00am View
   
Have you tried önclick="Register1_Click" event...
TrushnaK 28-Oct-13 5:49am View
   
In GridView1_RowEditing() event you have to check the
dropdown selected value. If value is <> 0 then check text box value.
TrushnaK 28-Oct-13 2:56am View
   
what you have tried so far....
post you tried query and table stucture.
TrushnaK 28-Oct-13 1:39am View
   
Post your code....
TrushnaK 24-Oct-13 3:19am View
   
flashing means...
TrushnaK 23-Oct-13 1:13am View
   
Are you sure about the path "CustomerEdit.aspx"
or else
use like "~/CustomerEdit.aspx"
TrushnaK 22-Oct-13 8:48am View
   
i have updated my query will it work fine...
TrushnaK 22-Oct-13 6:06am View
   
Not cleared elaborate your question.
TrushnaK 22-Oct-13 5:58am View
   
Deleted
Check the link
TrushnaK 22-Oct-13 3:03am View
   
yes that you have to change in javascript and add css.....
TrushnaK 22-Oct-13 1:56am View
   
No... Just click on link.
TrushnaK 22-Oct-13 1:45am View
   
improve your question and add code what you done so far...
and elaborate your question what you want exactly.
TrushnaK 22-Oct-13 1:29am View
   
Have you chacked your dataset dtResult having records before returning....
TrushnaK 21-Oct-13 3:06am View
   
are you getting session expire error or else?
Have you checked session timeout of your session.
TrushnaK 21-Oct-13 2:01am View
   
if (d.Year < 1990 && d.Month < 1 & d.Day < 1 )
this is not enough condition for validate date.
you have to check year , month > 12 and day according to month.
also consideration for leap year.
TrushnaK 18-Oct-13 10:03am View
   
Use minimum numbers of sessions variables.
i dnt know your senario but i think add your all info in array or datatable and then add that array or datatable into session.
TrushnaK 18-Oct-13 4:29am View
   
welcome....
TrushnaK 17-Oct-13 7:06am View
   
please elaborate your question....
TrushnaK 17-Oct-13 6:59am View
   
Not clear.. be specific when you asking question

Is there auto generated columns
TrushnaK 14-Oct-13 9:42am View
   
Constructor is a member function.You can have if statement in a constructor.
TrushnaK 4-Oct-13 8:08am View
   
what is your question?
TrushnaK 19-Sep-13 6:55am View
   
post your code. what you have done so far?
TrushnaK 17-Sep-13 7:13am View
   
welcome...
more clear when you asking question
best luck
TrushnaK 17-Sep-13 7:02am View
   
I have updated the solution. Is it ok....
TrushnaK 17-Sep-13 6:48am View
   
you didn't mention about aspx page
TrushnaK 17-Sep-13 3:53am View
   
Debuge and Check values in this line:-
Convert.ToInt32(txtCorridorName.Text), Convert.ToString(cmbStudentNumber.SelectedValue),
TrushnaK 16-Sep-13 7:16am View
   
this one is like that
http://www.twospy.com/galleriffic/index.html
TrushnaK 16-Sep-13 5:48am View
   
are you tried jQuery slideshow?
TrushnaK 16-Sep-13 5:43am View
   
check whether you have given the reference of your ajax dll from current projects bin folder or another location.
TrushnaK 16-Sep-13 1:54am View
   
is your sl.no field is auot-increamented?
TrushnaK 14-Sep-13 4:15am View
   
connectionString="Data Source=PCName;Initial Catalog=DB_NAme;User ID=;Password="
TrushnaK 14-Sep-13 2:22am View
   
can you show your gridview code?
TrushnaK 14-Sep-13 2:16am View
   
before using session read about it.
sessions is not about 2 users or 100 users.
TrushnaK 13-Sep-13 1:53am View
   
String was not recognized as a valid DateTime. It describes itself that you passing wrong datetime.

can you post your code what you done so far?
TrushnaK 13-Sep-13 1:43am View
   
have you gone through select into statement.
SELECT *
INTO tempTbl2 IN 'Backup.mdb' --second table
FROM tempTbl1; --first table
TrushnaK 13-Sep-13 1:40am View
   
Add updatepanel before your gridview and close after grid ends.
then update that panel after binding data to gridview in text changed event.
TrushnaK 12-Sep-13 1:52am View
   
Checkout your postal code on

http://jsfiddle.net/hgU3u/


^ matches beginning of string
[1-9][0-9]{3} matches a single non-zero digit, and three 0-9 digits
? matches 0 or 1 spaces (you could use * to match 0 or more spaces)
(?!sa|sd|ss) is a lookahead test to check that the remainder is not "sa", "sd", or "ss".
[a-z]{2} matches 2 a-z characters
$ matches the end of the string
/i at the end (from sabof's answer below) to simplify this (otherwise you would need to test !sa, !SA, etc... would be unnecessarily lengthy)