|
How to Authenticate Users with the SQL Server database table. I am using ling to entity data model.
|
|
|
|
|
I suggest you read the link in my sig. Or just buy a damn book instead of asking us to do your work for you.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
database tables are not an authenticaion mechanism. You can store data that can be used by your authentication mechanism, but it isn't a mechanism per se.
Your question, therefore, is larger than the scope of a forum reply. You would do well to find a tutorial on authentication in what ever OTHER technology (e.g. ASP.NET, WinForms, etc.) you are using and how to do that with SQL Server.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
have two tables. Roles and Users. In Roles I have three columns iID(PK), Role(varchar), Description(varchar).
In User table I have columns ID(PK,FK), Username(varchar), Password(varchar), Role(int).
First I fill data in Roles table then now I am trying to insert data in User
table it is giving me following error.
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint
"FK_User_Role". The conflict occurred in database "DataFeed", table
"dbo.Role", column 'Id'.
The statement has been terminated.
|
|
|
|
|
The reason you're posting a ton of questions, is that you have no idea what you're doing. Add a book on SQL to your list. Do you know what this error means ? If not, you should NOT be working on database code. But, that's the point, isn't it ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
I have read this and you have not asked a question. You have supplied a series of incomplete, random and contradictory statements.
In one statement you say that in the table "Roles [you] have three columns iID(PK)...". However, the error message says the conflict is on "table
"dbo.Role", column 'Id'."
Please provide the CREATE TABLE statement for the Roles and Users tables, also provide the INSERT statement that failed.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Just realised I'm in the ASP.NET forum - Why are you asking this here? It is a database question!
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Hi,
I am using Login control in my login.aspx page. I have a user table in my sql databas where user name and password are stored. After filling username and password in login page I want to check if it matches with the username and password with the data in the user table. How can I do that.
Regards,
|
|
|
|
|
Use SQL
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
Hello Friends, I am new to ASP.net.
I want to make an asp.net page (which look like a spreadsheet)wherein, the user enters some data in one or more columns. Clicks the button, & the required result is displayed on another page.
I made a simple editable gridview in asp.net (default.aspx) and put some numeric data & clicked the button.
Now how can I pass the values ( as an array) stored in one or more columns to another page(result.aspx) to carry out further analysis.
I want to call following method to data array(values stored in column of previous page)
public static double Mean(double [] data) //DATA IS THE COLUMN OF GRIDVIEW
{
int n = data.length;
double mean = Sum(data)/n;
return mean;
}
Please Help with Proper Coding for storing GridviewColumn in session & then retrieve it onto another page to call the method above.
PLEASE HELP
|
|
|
|
|
ashutosh_karna wrote: Please Help with Proper Coding for storing GridviewColumn in session & then retrieve it onto another page to call the method above.
You should read the link in my sig.
The most common way to do what you want, is to store the data in a database, and pass an id on the URL to a page that uses that id to read and display the data
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
(VS 2005)
Is there any way to have 1 column available for editing for all rows at the same time using GridView?
If you know how to do this a code snipet would be appreciated.
Thanks Chuck
|
|
|
|
|
I don't have a code snippet but you can use a template column in edit mode. Put all the fields in one template.
I didn't get any requirements for the signature
|
|
|
|
|
Given that I have a crystal crosstab report with salesmen on the left column and months across the top, with the intersection being the number of sales made that month.
Jan Feb Mar
Joe 5 7 4
Mary 12 6 8
How can I make the number of sales made for a given salesman / month combination a hyperlink with the corresponding query parameters ?
Something like this, "http://myserver/myapp/mySubreport.aspx?User=Joe&Month=Feb"
I'm currently using a formula in the "HyperLink" section of crosstab to generate a URL, however the URL that is generated by the function is the same value regardless of which "count of sales" field I click on.
For example, if I click on the first count,5, the URL is "http://myserver/myapp/mySubreport.aspx?User=Joe&Month=Jan" (good)
However, when I click on any of the other counts, say 7,4,12,6 or 8, the exact same URL is being generated.
How can I write the HyperLink formula to generate the desired values ?
OR
How else can I solve this problem ? Basically, I'm looking to create a crosstab report with the ability to drill-through to a more detailed report.
Thanks in advance.
David
|
|
|
|
|
what is your solution?
i have the same issue.
Tommy
|
|
|
|
|
I have two tables. Roles and Users. In Roles I have three columns iID(PK
|
|
|
|
|
I think your design is missing a table.
Typically this type of situation is implemented as follows:
Users table (contains a list of valid users)
Roles table (contains a list of valid roles)
RoleMembership (this shows which users are associated with which roles)
For example:
Users: A,B,C
Roles: R1, R2, R3
Role Membership
A,R1
A,R2
B,R1
C,R1
C,R3
|
|
|
|
|
Hi,
I am using membership and roles to secure my web site. Instead of creating data base in APP folder I want to excess my tables named Users and Roles into my sql server database. How can Ido that.
Regards,
|
|
|
|
|
Hello Friends, I am new to asp.net , so please help me out.
I have made a small gridview ( without any database connectivity) on page(Default.aspx). The user fills up one of the column with numeric data & clicks a button & control is transferred to another
page(Results.aspx).
Can anybody tell me how can I pass the whole gridview as session varaible & then retrieve it in another page & further retrieve the column filled up by the user.
Code in "Result.aspx"
protected void Page_Load(object sender, EventArgs e)
{
DataView dv1 = new DataView();
DataTable dt1 = new DataTable();
Session["A"] = dv1.Table.Columns["A"];
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
// double[] data = new double[Session["A"]]; // WRONG CODE . PLEASE CORRECT IT
// WRITE CODE FOR RETRIEVING COLUMN THAT USER HAS FILLED UP IN GRIDVIEW IN default.aspx
}
Code in "Default.aspx" :
protected void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("NewPage.aspx");
// HOW TO PASS GRIDVIEW ALONG WITH USER DATA
}
|
|
|
|
|
//Default.aspx
protected void Button1_Click(object sender, EventArgs e)
{
Session["A"] = GridView1.Columns["A"];
Server.Transfer("NewPage.aspx");
}
//Result.aspx
protected void Page_Load(object sender, EventArgs e)
{
GridViewColumn col = (GridViewColumn)Session["A"];
GridView2.Columns.Add(col);
}
|
|
|
|
|
You don't store presentation objects and pass them around. Have you even tried this? I doubt it very much
only two letters away from being an asset
|
|
|
|
|
ashutosh_karna wrote: how can I pass the whole gridview as session varaible
You don't want to do that. GridView is just a presentation of the data. You don't pass textboxes and other such controls between pages do you?
Allow the users to fill in the data, save it, then transfer to the next page, retrieve the data and present it on that page.
In anticipation of the line of thought, no you don't want to save the DataSet, or whatever storage object you are using, in session state either. A DataSet can take quite a bit of memory depending on what is in it, it wouldn't scale very well.
only two letters away from being an asset
|
|
|
|
|
The code above actually saves the data in a session. If he doesn't want to do the saving in the first page better save data into a Session and retrieve in the second page. Less burden on the Database too.
|
|
|
|
|
Ibrahim Bello wrote: Less burden on the Database too.
And when the data being stored in session is large or the number of concurrent users is high?
only two letters away from being an asset
|
|
|
|
|
No, surely not
If that is the case (and he hasn't said whether it is) saving to database will be better.
|
|
|
|