|
You said that you are using database only for storing USername and Password so it should not take much more time ..................
How are you storing the UserName in application not in Database
nilesh how much time it is taking now (as you want to reduce it )
VB Script aur javascript client side run hoty hai .......... Not Possible
Don't know by using Ajax you can do that ot not
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Sandeep lakin database interactions ke bina bhi aur bahut kuch hai.
adding deleting editng saving.
please help......
|
|
|
|
|
Sonia Gupta wrote: ke bina bhi aur bahut kuch hai.
??????
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That is Hindi language.
Regards,
Satips.
|
|
|
|
|
Is it possible to send an array of elements from one page to another aspx page..??
I am using Visual Studio.Net 2003,Asp.net with C#.
I am interested in passing an array of elements as a whole to another page.
Is that practically possible?If so,How can I go about it?
Happy Programming!!!
|
|
|
|
|
|
Hi
I m trying to populate dropdown list using XMLDatasource control.
code for DDL:
<asp:DropDownList ID="ddlLanguages" runat="server" Width="277px" DataSourceID="XmlDataSource1">
</asp:DropDownList>
Code for XMLDataSource:
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Languages.xml"></asp:XmlDataSource>
it does not displaying data, it is just showing system.web.UI.WebControls.XMLDatasource
Shahzad Aslam
Software Engineer
|
|
|
|
|
See my example which works fine...
<code><asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="XmlDataSource1"
DataTextField="name" DataValueField="name">
</asp:DropDownList>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml">
</asp:XmlDataSource></code>
The xml file:
<code><?xml version="1.0" encoding="utf-8" ?>
<fruits>
<fruit name="apple" />
<fruit name="pear" />
</fruits></code>
HTH
Janet
|
|
|
|
|
the following XML file i m using:
<languagenames>
- <!-- language names in English
-->
- <languagename>
<languageused>en</languageused>
<languagedescribed>aa</languagedescribed>
<name>Afar</name>
</languagename>
- <languagename>
<languageused>en</languageused>
<languagedescribed>ab</languagedescribed>
<name>Abkhazian</name>
</languagename>
</languagenames>
if i give name in the DataTextField or DataValueField it indicate following error:
"DataBinding: 'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a property with the name 'name'"
Any Idea?
Shahzad Aslam
Software Engineer
|
|
|
|
|
|
Dear Developers
I'm reading and showing RSS in a Datalist. But I'm unsure how to get values from attributes having colon( : ). Like http://www.carmagazine.co.uk/car.rss[^] uses colon( : ) in field "cfi:lastdownloadtime".
When I use DataBinder.Eval(Container.DataItem, "title") in datalist, it give an error. Any idea how to access this attribute???
-- modified at 6:56 Wednesday 4th July, 2007
|
|
|
|
|
Hi,
I have an object tag as below.
<object id="basket" name="basket" classid="http:/public/bin/SmartControls.dll#Mycompany.SmartControls.DocumentDownload" height="0" width="0" viewastext="">
<param name="Protocol" value="<%= GetContextProtocol() %>" />
<param name="Domain" value="<%= GetContextDomain() %>" />
<param name="DocumentRetrievalURL" value="showDoc/Research.dox?docIDs=" />
And from the javascript I am calling a method present in this dll as below
function SmartClientDownload(XmlString)
{
var err = "";
try {
alert("basket = " + document.all("basket"));
basket.Context= XmlString;
basket.Download();
}
catch(e){
err="There was an error on this page.\n";
err+="Error description: "+e.description+"\n";
alert(err);
}
}
Here I get an error Object doesn't support this property or method.
Sometimes it work sometimes it fails, Let me know if you have faced this issue.
Thanks and Regards
Irsh
|
|
|
|
|
irsh_is wrote: Here I get an error Object doesn't support this property or method
Where in the code is it failing?
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Hi Richard,
Thanks for responding.
I am getting the error in this statement.
basket.Download();
There is a method called Download() in the assembly which i am trying to access. It fails with the exception i have told before
Thanks
Irsh
|
|
|
|
|
hi,
could anyone correct my code to make cast between two generic list of object
public List<string> GetAllBrands()
{
List<tblbrand> ListBrand;
//this line of code contain an error
ListBrand = (List<tblbrand>)Product.GetAllObjects("Brand");
......
}
public static List<object> GetAllObjects(string ObjectName)
{
...
}
thanks in advance !!!
|
|
|
|
|
Are you looking to do something like this?
public List<TblBrand> GetAllBrands()
{
return Product.GetAllObjects<TblBrand>("Brand");
}
public static List<T> GetAllObjects<T>(string objectName)
{
...
}
|
|
|
|
|
Hi,
Please forgive my ignorance, as ive not done much development on the Microsoft side for a few years, and im just moving back onto .Net 2.
My problem is i am displaying a simple list of words from an SQL2005 DB. However i need to display the info alphabetically across three columns ie:
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
or even:
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
etc. How do i do this / which control is the best method? Im not properly aqauinted with the 'new' controls in 2.0
Thanks in advance.
|
|
|
|
|
Take a look at DataList. With this control you can define the number of rows or columns and the repeat direction.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
|
in my application, there are some pages that are secured & some are non secure. all the pages are displayed in an iframe. how can i apply form authentication for secured pages?
Thanks & Regards,
SAMir Nigam,
Software Engineer,
STPL, Lucknow, India.
|
|
|
|
|
I am building an ASP.Net C# Web project. in the HTML form of the .aspx file
I have
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
SqlConnection conn = new SqlConnection("Data Source=DATA-SERVER;Initial Catalog=Intech;Trusted_Connection=true");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM users WHERE username='"+Username.Value+"' AND password= '"+Password.Value+"'";
// Fill our parameters
cmd.Parameters.Add("@username", SqlDbType.NVarChar, 64).Value = Username.Value;
cmd.Parameters.Add("@password", SqlDbType.NVarChar, 128).Value = Password.Value; // Or "sha1"
// Execute the command
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
// Create a new ticket used for authentication
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, // Ticket version
Username.Value, // Username associated with ticket
DateTime.Now, // Date/time issued
DateTime.Now.AddMinutes(30), // Date/time to expire
true, // "true" for a persistent user cookie
reader.GetString(0), // User-data, in this case the roles
FormsAuthentication.FormsCookiePath);// Path cookie valid for
// Encrypt the cookie using the machine key for secure transport
string hash = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(
FormsAuthentication.FormsCookieName, // Name of auth cookie
hash); // Hashed ticket
// Set the cookie's expiration time to the tickets expiration time
if (ticket.IsPersistent) cookie.Expires = ticket.Expiration;
// Add the cookie to the list for outgoing response
Response.Cookies.Add(cookie);
// Redirect to requested URL, or homepage if no previous page
// requested
string returnUrl = Request.QueryString["ReturnUrl"];
if (returnUrl == null) returnUrl = "/";
// Don't call FormsAuthentication.RedirectFromLoginPage since it
// could
// replace the authentication ticket (cookie) we just added
Response.Redirect(returnUrl);
}
I have the table as
CREATE TABLE users
(
username nvarchar(64) CONSTRAINT users_PK PRIMARY KEY,
password nvarchar(128),
roles nvarchar(64)
)
CREATE INDEX credentials ON users
(
username,
password
)
Now I am trying to access the table but at
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
I am not getting any result from reader.Read();
I need help.
|
|
|
|
|
netwizerd wrote: cmd.CommandText = "SELECT * FROM users WHERE username='"+Username.Value+"' AND password= '"+Password.Value+"'";
// Fill our parameters
cmd.Parameters.Add("@username", SqlDbType.NVarChar, 64).Value = Username.Value;
cmd.Parameters.Add("@password", SqlDbType.NVarChar, 128).Value = Password.Value; // Or "sha1"
Fill out what parameters? You aren't using any parameters in the SELECT statement.
To use the parameters you should write:
cmd.CommandText = "SELECT * FROM users WHERE username=@username AND password=@password";
netwizerd wrote: I am not getting any result from reader.Read();
Perhaps the data does not exist. Or...
netwizerd wrote: reader.GetString(0), // User-data, in this case the roles
The first column isn't the roles. You've used SELECT * so in fact you don't know which column will be the roles because the columns will be returned in what ever order SQL Server decides is most efficient. You must use SELECT roles to ensure that the roles column is the first one.
By the way - for security you should also consider using a salted hash for storing passwords.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Thank you Colin but I used username=@username AND password=@password before but still my SQLDataReader was empty it was producing any result.
Yasin
|
|
|
|
|
I do recommend using the Parameter route. They help prevent SQL Injection Attacks.
Have you tried writing the same query and running directly on SQL Server? Do you get any results?
I'm actually thinking that since you are only ever getting one value back (the roles) that ExecuteScalar would be better for your requirements (unless you are planning to get more data from the reader in the future)
ExecuteScalar retrieves one value only, the fist column of the first row. It will manage the data reader for you, so you don't have to worry about it. All you need to do is call ExecuteScalar instead of ExecuteReader and if the value isn't null you have matched the login.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Some people are just a bunch of ungrateful pricks! I did my best to answer the OP here by suggesting various things to look at for a problem that is not immediately apparent. But someone thought it was worthy of a 1-vote.
I think I'll concentrate on writing articles and organising events instead of trying to help out here.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|