|
ssweetu wrote: I need date of birth in a form through three dropdownlistbox,one is day,second is month,third is year,and Date of Birth is stored in one column "date" in database.
What problem are you facing to doing that ? Take the selected item from three dropdown list, and then concate them store them as date in DB.
|
|
|
|
|
If you don't know how to do this, then you don't know enough to do any ASP.NET, really. so, you should buy a beginner book and read it. You should also distinguish between sites where you post your code and ask for help, and where you post a spec and pay people to write stuff for you.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi..
I have stored procedure to display listofdays by using year and month.My Storedprocedure filter all the Listofdays by leapyear and by month it will display listofdays.
In my stored procedure i used two parameters month & Year.I want to bind lisofdays spro in code behind with two parameters and how i call this listofdays method to my dropdownlist??
I am using below methods for binding the data into datatable.
Getdatatable Method
sqlconn = GetConnection();
cmd.Connection = sqlconn;
da = new SqlDataAdapter(cmd);
dt = new DataTable();
da.Fill(dt);
return (dt);
Calling My Spro
cmd = new SqlCommand("ndi_sp_GetDaysOfMonth", sqlconn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Month",DbType.Int16));
cmd.Parameters.Add(new SqlParameter("@Year", DbType.Int16));
return GetDataTable(cmd);
The method is correct.??If so when i put breakpiont and checking its not filling the data in datatable.
Hope someone reply to my message..Thanks in advance
|
|
|
|
|
The obvious question is, is your stored proc correct? Is the SqlCommand being executed properly but no data is being returned?
Seems critical thinking and debugging skills are a lost art.
only two letters away from being an asset
|
|
|
|
|
Yes..I Tested and executed my spro.Its working.When i am adding parameter values year and month..its displaying listofdays according to month and year.
|
|
|
|
|
Ok, so what else could you test? Apply some thought processes. It will develop your skills and may lead to an answer without having to ask people to solve it for you.
only two letters away from being an asset
|
|
|
|
|
I have a master page in my application and there is one heade and footer. The issue is when the child pages contain less content, the footer comes up, else it comes down. Is there any way that I can made it as static? Means I want to display the same at the bottom center.
Probably it will be some settings on CSS/HTML. Can anybody please provide any link or examples to that. I tried to put align="center" in <tr>, but doesn't have much effect. Can anybody provide any suggestion?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
One thing is that you appear to be using tables to define the structure. You should be using CSS instead. Create a container, such as a div, for the content that is sized as appropropriately. You will of course need to have it scroll the content or you'll still have the same problem.
only two letters away from being an asset
|
|
|
|
|
meeram395 wrote: The issue is when the child pages contain less content, the footer comes up, else it comes down. Is there any way that I can made it as static?
why you are not fixed the table width and height ?
|
|
|
|
|
Why use a table at all? A proper application of CSS will accomplish the same thing and render faster.
only two letters away from being an asset
|
|
|
|
|
Add the following styles to the footer class:
position: fixed;
bottom: 0;
However, this will probably not give you the result you want.
You probably want one of 2 effects:
1. header and footer always visible, body has vert scroll bar.
to do this use the fixed and top/bottom styles for the header/footer and set overflow to auto or scroll.
2. footer is at bottom of window if body less than window height, else it's at normal location at bottom of (scrolled) page.
need to use javascript e.g. something like http://www.ben-griffiths.com/project/jquery-position-footer/[^] ... although this solution is overly complex and doesn't handle ajax added data.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
void Session_End(object sender, EventArgs e)
{
}
this method call when session timeout but i want when user close the explorer
then
void Session_End(object sender, EventArgs e)
{
}
call
thanks
|
|
|
|
|
You still have the earlier question in this page itself. It would been easier for people to understand the background too.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
The Session_End event cannnot be handled when the browser is closed.
Some people suggest to handle onbeforeunload javascript event.
But it is not advisable because you cannot differenciate between a postback and browser close(clicking X button).
Also the link button will trigger this event twice.
|
|
|
|
|
You don't need to thing about it. It will close automatically when the session is time out !!
|
|
|
|
|
Thanx Everyone for Replying me and helping me out in my previous posts...
Well now i need an advice from you regarding the following error that i have received...
I actually Try 2 insert a record from my asp page with the same details that already exists in the table.. how do i handle this exception. i dont have a proper idea regarding handling errors... Do please help... i receive the following error...
"Violation of PRIMARY KEY constraint 'PK__studentreg__0BE6BFCF'. Cannot insert duplicate key in object 'dbo.studentreg'"
thanx in advance...
|
|
|
|
|
The exception clearly says that you are violating primary key constraint.
A simple way is to put try catch statement aroung your table inserting code.
Then handle SqlException and check the value of the Number property of the SqlException object if it equals to 2627.
try
{
}
catch(SqlException ex)
{
if (ex.Number.Equals(2627))
{
}
}
modified on Wednesday, July 1, 2009 8:16 AM
|
|
|
|
|
Thanx alot... It worked out...
|
|
|
|
|
You need to check if the record exists for the primary key.
Only do a insert if the record does not exist. In other case, update the existing information (if it suits your application needs)
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Is it possible to post a msg to the user using a label stating that the record already exists..
|
|
|
|
|
Yes, First you could check whether the Record exists using Primary Key Field,if exist then display the msg in label,if not add it.
|
|
|
|
|
Thanx for help...
Things are fine now...
|
|
|
|
|
hi,
how to i determine that session is closing in asp.net?
i want do something when session is closing.......as in desktop application where fromclosing call
thanks
|
|
|
|
|
Have a look at the global.asax file. There should be a method named "void Session_End(object sender, EventArgs e)". That's the one called by the engine whenever a session is closing/ends.
|
|
|
|