no I don't need to use the calender but I need only return birthdate from database into variable as DateTime and then spilt it into day to put it in the dropdownlist , month into another dropdownlist , year into textbox to update information about user .
So you want to use three query, with all the overhead, to return one value, DateTime, which already has the properties for Day, Month, Year. Even if you combined into one query it is still unnecessary to separate the values in the SQL statement.
how I can get the birthday from column in database ( as datetime type ) and display it in a separate dropdownlist one for day and other for month and textbox for year .
I want get the information to update on it .
for that task
first you have to create two dropdownlist for day and month and fill them.
then try this code
DateTime _bdate = DateTime.Now; -- get this date from database field
int day = _bdate.Day; -- return int value(find day of datetime field like that)
drp_day.SelectedIndex = -1;
drp_day.Items.FindByValue(Convert.ToString(day)).Selected = true; -- bind that perticulare day to dropdownlist by that
hope this helps and also same down for month (_bdate.Day) and year (_bdate.Year)
all the labels can see the ADMIN in the MASTER PAGE note[that labels is isn't the ContentPageHolder, i put it in the OUTSIDE]
and the other user can SEE that labels on their SPECIFIC type,
this my CODE for my SEPARATED Log in page and it's in the same project located also[hope you'v gonna get it^_^]
Partial Class _Default
Dim cn As New OleDbConnection
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = ""
If .State = Data.ConnectionState.Open Then .Close()
.ConnectionString = "Provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("data\database.mdb")
Catch ex As Exception
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
If txtUsername.Text = "" Or txtPassword.Text = "" Then Exit Sub
.CommandText = "Select * from tbluser Where userid = '" & Trim(txtUsername.Text) & "' and passid = '" Trim(txtPassword.Text) &"' "
.Connection = cn
dr = .ExecuteReader
If dr.HasRows Then
Session("name") = txtUsername.Text 'it will display o the other page, it depends
Response.Redirect("Main.aspx") 'my main.aspx is connected to my MASTER PAGE and all the other page
Label1.Text = ("ERROR! " & txtUsername.Text)
what code i'm gonna suppose to do? and where i'm gonna put it??
please.. i need some help...
just to enabled, disabled, visible = TRUE or FALSE the specific ITEM like BUTTONS and LABELS that depends on the USERTYPE...
thank for READING i hope READER's can HELP ME..
THANKS in ADVANCE ^_^
My Vote of 1 too to this poor guy. You are right, but he may also not be wrong, seeing professors in Indian Engineering Colleges.
they will teach you basics of C Programming and one day will tell you go and make a Chat application. That's very common.
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
It does not work like this here. This is your college project/assignment, you should put some effort.
We expect you to put some time in trying the issue that you are facing and then some time in formulating the question while posting here. Try it and tell if you face issues. Members will be more than happy to help like this.
To start with: There are lots of chat application articles here on CodeProject itself. Have a look at them (but don't copy!).