|
Is there no way to assign query to select command of sqldatasource dynamically ?????
G. Satish
|
|
|
|
|
assign country name in a session and use this value of session in sqldatasource where condition.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
how should we convert the system date time format with "-" (dd-MMM-yyyy) to the format which we needed in the project i.e dd/MM/yyyy without making change in the system how shall we change in coding in asp .net 1.1 C#
|
|
|
|
|
try
Now.ToString("dd/MM/yyyy")
|
|
|
|
|
Check this link out
Convert date time
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
i am using the following code to open dropdown list while validating,but the
problem is that i am increasing size of DDL so that it looks like it is opened but by doing so it disturbs the formatting of all those controls which are below to it,so can you plz give a good code or suggestion for opening dropdown list on button click while validating.
<br />
<script language="javascript" type="text/javascript"><br />
<br />
<br />
function ddl_focus()<br />
{<br />
if(document.getElementById("<%=DropDownList1.ClientID %>").value=="0")<br />
{<br />
<br />
document.getElementById("<%=DropDownList1.ClientID %>").focus();<br />
open_ddl();<br />
}<br />
<br />
}<br />
<br />
function open_ddl()<br />
{<br />
document.getElementById("<%=DropDownList1.ClientID %>").size=10;<br />
}<br />
<br />
function close_ddl()<br />
{<br />
document.getElementById("<%=DropDownList1.ClientID %>").size=1;<br />
}<br />
<br />
<br />
</script><br />
<br />
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<br />
<table>
<tr>
<td style="width: 461px">
</td>
<td style="width: 239px">
</td>
<td style="width: 273px">
</td>
</tr>
<tr>
<td style="width: 461px">
<asp:dropdownlist id="DropDownList1" onmouseout="return close_ddl();" onmouseover="return open_ddl();" runat="server" width="125px" xmlns:asp="#unknown">
<asp:listitem value="0"><Select></asp:listitem>
<asp:listitem value="1">Agra</asp:listitem>
<asp:listitem value="2">delhi</asp:listitem>
<asp:listitem value="3">mumbai</asp:listitem>
<asp:listitem value="4">chennai</asp:listitem>
</asp:dropdownlist>
<asp:requiredfieldvalidator controltovalidate="DropDownList1" errormessage="RequiredFieldValidator" id="RequiredFieldValidator1" initialvalue="0" runat="server" setfocusonerror="True" xmlns:asp="#unknown">Plz select from ddl</asp:requiredfieldvalidator>
<asp:updatepanel id="UpdatePanel1" runat="server" updatemode="Conditional" xmlns:asp="#unknown">
<contenttemplate>
<asp:button id="Button1" onclick="Button1_Click" runat="server" text="Button" onclientclick="return ddl_focus();"></asp:button>
</contenttemplate>
</asp:updatepanel></td>
<td style="width: 239px">
</td>
<td style="width: 273px">
</td>
</tr>
</table>
Maniiiiiiiiiiiiiii
|
|
|
|
|
Hi I am developing an webpage.In my webpage there is a textbox.According to the textbox value,some details come on a button click.In button click event I've initialized OracleCommand object.My code is working for two times.But third time when I press the button,an error occurs saying object reference not set to an instance of an object.
I have done such codings thousands of time.But this time I am clueless why this is happening.Can any one help me out?
ARINDAM
|
|
|
|
|
Are you closing your OracleCommand.
Try putting in a break point so you find exactualy one which line your code is breaking.
|
|
|
|
|
I have put break point.It is showing the error in
string variablename=command.ExecuteScalar().Tostring().
While OracleCommand command=New OracleCommand() line is executing properly before the line at which error occurs.
Mysteriously for first two button click it works properly,but at third attempt it gives the error.
ARINDAM
|
|
|
|
|
can u plz mention that line where error occurs...
Maniiiiiiiiiiiiiii
|
|
|
|
|
If the query is returning null it could cause this error.
Check your query.
Also add a try Catch so the program doesn't stop running.
Hope this helps.
|
|
|
|
|
Hi all,
I m trying to create an custom shopping cart.
the scene is whenever an user adds any product into his shopping cart the quantity of the product which he has added should be reduced from the actual quantity of the product so as we may not get order more that the actual quantity. during the time the product remains in the users cart the the product quantity available for other user is shown less so as they may not order this product.
now the cart is set to expire in 15min if idle.
I m using cookies to create the cart. storing the product Id and quantity but the problem is how can I update the quantity if a person's cart expires.
any suggestion.
thanks & regards
Vijay V.
Yash Softech
|
|
|
|
|
You need to be able to check if the cookie has expired. When the cookie has expired move the quantity back into the table where the quantity of the product is.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
hi,
i can read that but how can I trace that cookie is expired and how do I maintain that this much quantity is taken by someone or is in someones cart so not allow anyone else add to their cart?
how can I detect that this product is added in someones cart??
Vijay V.
Yash Softech
|
|
|
|
|
I think like Christian said below it may be better to use tables.
Imagine one of your tables in your database is the shopping cart and then store the details in there. You could put an expiry time on the product, so say 1 hour and after that it is then removed from the shopping cart.
Run some code in your application which checks the table for any items which have been in there longer than an hour, if so delete them and they will then be removed from the shopping cart.
If you think logically about how to do this with tables it will become quite easy.
feel free to ask more questions
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
thanks for valuable suggestions.
I think I must create an web schedular that will constantly check for product expiry time and if they are still there after that I mean checkout is not done I must remove that items from that.
thanks for the help guys.
Vijay V.
Yash Softech
|
|
|
|
|
You have a design issue. Don't use cookies to store these details. Persist the details in a database, put a column which has expiry time. Write a SQL job which polls these table and remove expired rows.
|
|
|
|
|
does this mean I must put the details of the product being added to a temp table and adding the expiry time in an row and creating a scheduler which will keep on checking this time and if its about to expire time then update the products table with these values again and remove the temp table data.
but in this I will be updating the expiry time of the cart each time the user adds a new item in its cart with in this expiry time. the new time will be again the max time of expiry. so i will have to maintain multiple values for a particular user as shopping cart can have multiple products.
Vijay V.
Yash Softech
|
|
|
|
|
Just store the product ID in the table with the date it was added and the session ID. That will keep it simple.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
session id or user id?
how to delete this data when expired?
Vijay V.
Yash Softech
|
|
|
|
|
As I said before set a timer which checks what date it was added and then after an hour delete the row from the table.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
thanks for the help.
Vijay V.
Yash Softech
|
|
|
|
|
Hi
I saw many pages about this subject in microsoft msdn website but I don't how to do it.What I mean is I have downloaded virtual pc 2007 already but what next should I do?
I am too late but i will never give up
|
|
|
|
|
Hi all,
I have master page. In that i placed a LinkButton(Log Out).
If user clicks on this logout button, i am entering the login & logout information into database and i am deleting temporary folders.
Probem1 : When user closes Browser window by Closebutton(X), i need to enter the logout information into database & i need to delete temporary folders and files.
Problem2 : After user logout, how can i restrict user to navigate through previous pages by using Brower Back(< & Forward(->) buttons.
Please suggest how to achieve this...
Thanks in advance.
|
|
|
|
|
sekhar.k wrote: Probem1 : When user closes Browser window by Closebutton(X), i need to enter the logout information into database & i need to delete temporary folders and files.
function UpdateDataBase()<br />
{<br />
if(window.event.clientX < 0 && window.event.clientY <0)<br />
{<br />
window.open("UrLogic.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');<br />
}<br />
}
Urlogic.aspx will contain the database related operation and Check the locatoion of popup. user should not able to see it.
Call it on Masterpage onUnload
sekhar.k wrote: Problem2 : After user logout, how can i restrict user to navigate through previous pages by using Brower Back(< & Forward(-> buttons.
javascript:window.history.forward(1);
|
|
|
|