|
Can you not just convert it to a datetime in the c# and then set the datetime in the format you wish?
|
|
|
|
|
sorry. there is no need for conversion. how to format the datetime data displayed in the gridview. gridview is binded with sqlserver table.
Have A Nice Day!
Murali.M
|
|
|
|
|
You can convert it in the SQL query. Check this[^] to get an idea about using date formats.
|
|
|
|
|
You can do this using DataFormatString Property.
HtmlEncode="false" DataFormatString="{0:dd/MM/yyyy}"
Best Regards,
Chetan Patel
|
|
|
|
|
Hi everybody
I use a site map control in my site, but when I put it, a message appears "The file web.sitemap required by XmlSiteMapProvider does not exist"
How I can deal with this problem?
Thanks alot...
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Check out this discussion thread which shares the similar problem and explores through potential workarounds/solutions:
http://forums.asp.net/p/951128/1290904.aspx#1290904[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
a web.sitemap file is needed to SiteMap control. Create a web.sitemap control on your root.
|
|
|
|
|
Hi guys realy sorry to ask this quest in this forum,
I know little bit in vs2003 in that, to login i have given 2 textbox with that textbox values, i compared my database and given authentication to users,
But i am totally new in vs2005,i saw in that inbuilt login control,
In that login button if i click, i got login_autheticate function,
In that how to get the user entered username and password and compare to my tables?,
I have searched in google,they talked about membership provider,
and some bodies doing in webconfig file itself declared username and password,
I dont want to give like that,
the given username and password have to check with my database table then further process have to be done,
Its possible with that control or not?,This is my question,
how to do that?,
Plzhelp me about that
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
|
hi navaneeth thanks for ur reply,
Ya i saw that article but i didnt get any clear idea,
Becoz see this is my code in vs2003,
Function LoginAuthentication() As Boolean
Session("username") = txtuserName.Text
Session("userpwd") = txtPassWord.Text
Dim cmdtextproc As String = "authenticationmain '" & Session("username") & "','" & Session("userpwd") & "'"
sqldad = New SqlDataAdapter(cmdtextproc, sqlconn)
dst = New DataSet
sqldad.Fill(dst, "login")
Dim dt As DataTable = dst.Tables("login")
If dst.Tables("login").Rows.Count > 0 Then
Session("userid") = dt.Rows(0)(0).ToString()
Session("empid") = dt.Rows(0)(1).ToString()
Session("empname") = dt.Rows(0)(2).ToString()
LoginAuthentication = True
dst.Dispose()
sqldad.Dispose()
sqldad = New SqlDataAdapter("authenticationsub '" & Session("userid") & "'", sqlconn)
dst = New DataSet
sqldad.Fill(dst)
Session("MyData") = dst
dtmDate = DateTime.Now()
Dim td As String = dtmDate.ToString("D")
Dim hm As String = 1 & "" & hh & "" & mm & "" & ss
Dim strdate As String = CDate(td)
If Mid(strdate, 2, 1) = "/" Then strdate = "0" & strdate
If Mid(strdate, 5, 1) = "/" Then strdate = Left(strdate, 3) & "0" & Mid(strdate, 4, 6)
strdate = Mid(strdate, 1, 3) & Mid(strdate, 4, 3) & Mid(strdate, 7, 4)
Sqlcmd = New SqlCommand("SubmitHitter '" & Session("ProjectId") & "','" & Session("empid") & "','" & strdate & "','" & hm & "','" & Request.UserHostName() & "'", sqlconn)
Sqlcmd.Connection.Open()
Sqlcmd.ExecuteNonQuery()
Sqlcmd.Connection.Close()
Sqlcmd.Dispose()
Else
LoginAuthentication = False
Session("userid") = ""
Session("userpwd") = ""
Session("empid") = ""
Session("empname") = ""
End If
This cmds running while click my login button,
I am passing the username and pwd to storedprocedure and checking it its given i/p is correct or not,
But in that login control how u can fetch the username textbox id and the password textbox id and how u will pass it to database?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Hi,
I have a gridview that contains a textbox.
Now i want to set the default value of that text box to 0.
I have written the following code on the page load for that but is throwin the error "Object reference not set to an instance of an object".
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((TextBox)(GridView1.FindControl("TextBox1"))).Text = "0";
}
}
Please Help.
Regards,
Pranav Dave
|
|
|
|
|
You can also set it at design time
for example
<ItemTemplate>
<asp:TextBox id="MyTextBox" runat="server" Text="0" />
</ItemTemplate>
Or
If you want to set it at runtime,You can write your code on RowDataBound event of gridview.
On rowDatabound event,find out textbox and set default value 0.
<blockquote class="FQ"><div class="FQA">pranavcool wrote:</div>I have written the following code on the page load for that but is throwin the error "Object reference not set to an instance of an object".
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((TextBox)(GridView1.FindControl("TextBox1"))).Text = "0";
}
} </blockquote>
This error caused because you did not bind gridview.Rememeber,if you want reference of child control of data control,you must bind first parent control otherwise you can not get child control reference from the parent control
please don't forget to vote on the post that helped you.
|
|
|
|
|
Can any one help me on Browse Capabilities that support all the browser alignment issues......
Subash
|
|
|
|
|
|
I am developolong online examination for which i need Time countdown manner in which i am confued. please help me to solve it
thanks
noor alam
|
|
|
|
|
How about having a Javascript window.setTimeout on page load of every (question) page, similar to Brainbench?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello everybody,
I have created a javascript (ajax) making a request to the server for save the infomation i have passed as arguments with the request. like this
var args = "id=" + ID + "&name=" + Name + "&sex=" + Sex + "&age=" + Age;
xmlHttp.open("POST","SaveInfo.aspx",true);
xmlHttp.onreadystatechange = function theStateChanged()
{
if (xmlHttp.readyState==4 && xmlHttp.status==200)
{
alert("Successfully Saved");
}
}
xmlHttp.Send(args);
these are OK. but i want to catch the args from my asp.net webpage.
When i am using GET method for request, i am sending arguments by query string, and in .net page i can access that using Response.QuerySting["key1"].ToString(); But this time i am getting problem. how can i access the arguments passed. Please help me.
Thanks in advance for help.
Dipak
|
|
|
|
|
Hi sorry if i m posting this on the worong forum.
But i need help on this.
i need to ping a website but with different ip each time with the help of tor.
can ne1 help ne help will be appreciated.
Thanks
|
|
|
|
|
metallica_rock10 wrote: i need to ping a website but with different ip each time with the help of tor.
You need to explain more as your question doesn't make any sense.
|
|
|
|
|
metallica_rock10 wrote: tor
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hai frinedz,i want to populate data from Database in hirachary manner.
i have done up to 2level. but i dont know how to add one subchild in
the child node...can u plz do this with my existing code...
or tell me where should i add the code to a sub child under the child node.
here the parent node is -modulename
child node - componentname
& subchild node- function name.
in the sqlcommand you can put any sql....for ur conviennet .later on iwill change it according to my requirment.
plz do this favour on me.
i am using asp.net along with c# 2005 as front end and backend as sqlserver2005 as db
below i am giving u my code also..
======================================
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
PopulateRootLevel();<br />
}<br />
}<br />
<br />
void PopulateRootLevel()<br />
{<br />
<br />
SqlConnection SqlCon = new SqlConnection("Data<br />
Source=biswa;Initial Catalog=rwsNew;User ID=sa;Password=biswa007");<br />
Source=;Initial Catalog=rwsNew;User ID=;Password=");<br />
SqlCon.Open();<br />
SqlCommand SqlCmd = new SqlCommand("SELECT modulename,moduleid<br />
FROM module_master WHERE delflag='ACTIVE' ORDER BY modulename ",<br />
SqlCon);<br />
SqlDataReader Sdr = SqlCmd.ExecuteReader();<br />
SqlCmd.Dispose();<br />
string[,] ParentNode = new string[100, 2];<br />
int count = 0;<br />
while (Sdr.Read())<br />
{<br />
ParentNode[count, 0] =<br />
Sdr.GetValue(Sdr.GetOrdinal("moduleid")).ToString();<br />
ParentNode[count++, 1] =<br />
Sdr.GetValue(Sdr.GetOrdinal("modulename")).ToString();<br />
}<br />
Sdr.Close();<br />
for (int loop = 0; loop < count; loop++)<br />
{<br />
TreeNode root = new TreeNode();<br />
root.Text = ParentNode[loop, 1];<br />
root.Target = "_blank";<br />
//root.NavigateUrl = "Default.aspx";<br />
SqlCommand Module_SqlCmd = new SqlCommand("SELECT<br />
compid,componentname FROM module_component WHERE (moduleid = '" +<br />
ParentNode[loop, 0] + "') ", SqlCon);<br />
SqlDataReader Module_Sdr = Module_SqlCmd.ExecuteReader();<br />
while (Module_Sdr.Read())<br />
{<br />
TreeNode child = new TreeNode();<br />
child.Text =<br />
Module_Sdr.GetValue(Module_Sdr.GetOrdinal("componentname")).ToString();<br />
child.Target = "_blank";<br />
//child.NavigateUrl = "Default.aspx";<br />
root.ChildNodes.Add(child);<br />
}<br />
Module_Sdr.Close();<br />
TvMenu.Nodes.Add(root);<br />
}<br />
<br />
TvMenu.CollapseAll();<br />
SqlCon.Close();<br />
}<br />
thanks in advance
|
|
|
|
|
We can have two Web.config in a project.
In the first Web.config; in appSetting u have one connection and in the second Web.config u have different connection. Which connection does the project work.
Regards,
LEE
|
|
|
|
|
1) First thing how can you put two files with the same name in a web root ?
2) Second. Why are you opting for such a method of putting connection string in two different files as you can always put any number of connection string in same file and refer then uniquely using the name.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I am not using the web.config file in the same root. First web.config will be accessessed by the login and the second web.cofig in a specified folder where the connection is for that specified folder.
Regards,
LEE
|
|
|
|
|
I assume it will take only the one in the root. And when you run the application which one did it take ?
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|