|
Already answered, please check above.
|
|
|
|
|
I have a grid view which can have any number of records.
I have a text box to search for card numbers.
I highlight the rows with matching card numbers in RowDataBound event.
Now i want to bring the Highlighted rows to top. I do not want to remove all other records. I want to show all records and want to bring highlighted records to top.
I urgently need the solution for this query. Any help will be appreciated.
Thanks in Advance!
Inderjeet Kaur
I tried using
Select * from abc where condition = searchcondition
UNION ALL
Select * from abc where condition <> searchcondition
But, it works only if i have to search one fileld. Now i have to run search on two fileds it will return lots on rows
Inderjeet Kaur
Sr. Software Engg
|
|
|
|
|
What you can do , is to order by the Card numbers. do it on your SQL Side and the rows that have the card number you searched for will be on the top part
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi
Order By wll bring the rows in asc or desc order. What if i want in between records on top
SELECT
*
FROM
(
SELECT
TranID AS TranID,
CardAcceptorIdCode as MerchantNumber,
PrimaryAccountNumber AS CardNumber,
TranTime as TxnDate,
TransactionAmount as TxnAmount,
CASE CCL1.LutDescription WHEN 'REDEMPTION' THEN 'PURCHASE' ELSE CCL1.LutDescription END as TxnType,
CASE CCL1.LutDescription WHEN 'REDEMPTION' THEN 'CR' WHEN CCL1.LutDescription THEN 'DR' END as DbCrdDetails,
LocalTxnDate,
LocalTxnTime,
PrimaryCurrencyCode AS Currency,
TxnCode_internal AS MTC,
ISNULL(ExcludeRecon, 0) AS ExcludeRecon
--CASE ExcludeRecon WHEN NULL THEN 0 ELSE ExcludeRecon END AS ExcludeRecon
FROM
CCardTransactions inner join
CCardLookup CCL1 on TranType = CCL1.LUTCode and TranType in (10,40,37,42,30) and CCL1.LUTID = 'LM'
WHERE
TRANTIME BETWEEN 'Jul 29 2009 12:00AM' AND 'Jul 29 2009 11:59PM' AND
CardAcceptorIdCode = 48484
) AS CCARDTRAN1
WHERE
CardNumber = '2423423453534556'
--ORDER BY CardNUmber
UNION ALL
SELECT
*
FROM
(
SELECT
TranID AS TranID,
CardAcceptorIdCode as MerchantNumber,
PrimaryAccountNumber AS CardNumber,
TranTime as TxnDate,
TransactionAmount as TxnAmount,
CASE CCL1.LutDescription WHEN 'REDEMPTION' THEN 'PURCHASE' ELSE CCL1.LutDescription END as TxnType,
CASE CCL1.LutDescription WHEN 'REDEMPTION' THEN 'CR' WHEN CCL1.LutDescription THEN 'DR' END as DbCrdDetails,
LocalTxnDate,
LocalTxnTime,
PrimaryCurrencyCode AS Currency,
TxnCode_internal AS MTC,
ISNULL(ExcludeRecon, 0) AS ExcludeRecon
--CASE ExcludeRecon WHEN NULL THEN 0 ELSE ExcludeRecon END AS ExcludeRecon
FROM
CCardTransactions inner join
CCardLookup CCL1 on TranType = CCL1.LUTCode and TranType in (10,40,37,42,30) and CCL1.LUTID = 'LM'
WHERE
TRANTIME BETWEEN 'Jul 29 2009 12:00AM' AND 'Jul 29 2009 11:59PM' AND
CardAcceptorIdCode = 48484
) AS CCARDTRAN2
WHERE
CardNumber <> '2423423453534556'
This is my query and i want top bring records searched by CardNUmber or TxnType on top
Inderjeet Kaur
Sr. Software Engg
|
|
|
|
|
You can choose if you want them asc or desc by adding something like
Order by CardNumber asc
or
Order by CardNumber desc
Hope this Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Self Manipulation of Records of dataset is required here.
after binding the database initially and on card number entry,You try to highlight those matching rows and finally after completing highlight part,remove those all rows from dataset and insert at Top position and then rebind the Grid.This should be done at the end in order not to break performance issue.
Hope so I am correct.
All The Best
Sundeep Ganiga
When the only tool you have is a hammer, everything looks like a nail.
Come Forth Yourself to Click "Good Answer" for any expected solution.
Let us Support our C Project Programmers who provide solutions here.
|
|
|
|
|
i want to edit a grid view which contain a dropdownlist which is not bound to any datasource i want to use ListItem. How can i do so? What changes i have to do for my solution?
<asp:TemplateField HeaderText="Variable Price">
<ItemTemplate>
<asp:Label ID="tbPrice" Width="100px" runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlVariable"
Width="100px"
runat="server" />
</EditItemTemplate>
</asp:TemplateField>
|
|
|
|
|
Do you want to use them on the server side ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
|
that is Simple
DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlVariable");
as i dont know what column is this template field is, you can start counting from zero and but the correct index for the column
Hope this Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
what should be the code for server side scripting?
|
|
|
|
|
its what i gave you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
there itself near the dropdown u can add listitems
|
|
|
|
|
i want to take values from textbox and using a submit button i want to submit the records.
when i run the project it give errorFailed to convert parameter value from a String to a DateTime
Here is my code plz chk and reply
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
ErrorMessage.Text = "";
cnx.Open();
SqlCommand insertCmd = new SqlCommand("insert into Coupon_Info(ReceivingDate,Coupon_TypeID,Serial_Start,Serial_End,Recieved_By)values(@date,@CouponId,@Start,@End,@By)",cnx);
insertCmd.Parameters.Add("@Date", SqlDbType.DateTime);
insertCmd.Parameters["@Date"].Value = txtdate.Text;
insertCmd.Parameters.Add("@CouponId", SqlDbType.TinyInt);
insertCmd.Parameters["@CouponId"].Value = DropDownList1.Text;
insertCmd.Parameters.Add("@Start", SqlDbType.BigInt);
insertCmd.Parameters["@Start"].Value = txtbxFrom.Text;
insertCmd.Parameters.Add("@End", SqlDbType.BigInt);
insertCmd.Parameters["@End"].Value = txtbxTo.Text;
insertCmd.Parameters.Add("@By", SqlDbType.NVarChar, 50);
insertCmd.Parameters["@By"].Value = txtbxBy.Text;
insertCmd.ExecuteNonQuery();
ErrorMessage.Text = "Successful";
cnx.Close();
}
catch (Exception ex)
{ ErrorMessage.Text = ex.Message; }
}
|
|
|
|
|
|
hiii all....
i m using access database in my web site.
I want to use role and membership feature in my application.
tell me wheather i shud use customize provider or notplz guide me.
thanks in advance....
|
|
|
|
|
Hi all,
I want to allow the user to enter his password and press a confirm button from within his email. On the press of the button i need to do some serverside operations. Is this possible? Can we embed HTML controls in a mail body? Or is there any other way to achieve this?
|
|
|
|
|
This is basically not possible. I can think of some things you could do, but at the end of the day, any mail program worth anything, even if it shows HTML, and even if it will show text boxes, etc. ( which I am not sure of ), is going to complain if you try to send data from their program.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thank you for your reply.
|
|
|
|
|
Hi All,
I want to implement Web Part in my Existing Project. We have implemented our own way for User Creation and User Role facility in our project.
As you know, To implement web Part We need to use pre-built Tables and Stored Procedures.
But We dont want to use all these rather we want to implement Web Part with our existing working functionality.
Is there any way to implement Web Part in such a way so that our existing user creation and Role tables do not need to do big changes.
Is this possible.
your help is appreciated.
Thanks.
Sdhimann
modified on Thursday, August 20, 2009 1:33 AM
|
|
|
|
|
Hey guys need ur help again. I need to check the valid email address using asp.net
Below are the code i use
hostName = "yahoo.com";
private bool ValidSMTP(string hostName)
{
bool valid = false;
try
{
TcpClient smtpTest = new TcpClient();
smtpTest.Connect(hostName, 25);
if (smtpTest.Connected)
{
NetworkStream ns = smtpTest.GetStream();
StreamReader sr = new StreamReader(ns);
if (sr.ReadLine().Contains("220"))
{ valid = true; }
smtpTest.Close();
}
}
catch (Exception e)
{
string a = e.Message;
}
return valid;
}
However the error msg i receive is this
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Any solution or other methods of validating a exist email address?
Thanks
KaKaShi HaTaKe
|
|
|
|
|
There is no way to check if a mail address is valid, apart from mailing it and seeing if you get a bounceback message. Even that is not 100% accurate.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
after I get the id of the linkbutton (as follows), then how to change the backcolor of the button
I do not know which function can be used.
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
?
}
thanks.
|
|
|
|
|
Why you are not putting the LnkButton inside Div/Table and change the backcolor of that on mouseover of linkbutton.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks, I did not get you, anyway, above method is suggested by you (right?)
can you help me further for this?
for your new proposal, can you give me one example, how to do it?
|
|
|
|