Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am new to this asp.net and SQL. Here, i want to create a new role called Employee_Delete by using SQL server management studios. i have already database payroland a table called aspnet_Roles where all the roles ate listed. I Want this newly created role to appear in the same list. And then, When a user is assigned this role, then he would be able to delete the existing employee. And also the process to define that role so that it can perform its task i.e. in this case deletion.
I have gone through googling this problem but didn't get this exactly. Any help would be appreciated.
Thank You
exec aspnet_Roles_CreateRole
#ApplicationName = 'Application name as shown in your project',
#RoleName = 'RoleName
This is the actual query needed to create new role in the existing 'aspnet_Roles' from the SQL server management studio.
If you are using Membership and have enabled Roles, you can simply call Roles.CreateRole ("Employee_Delete") and add user to the role by calling Roles.AddUserToRole("username", "Employee_Delete")
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a question.
I need the table A add a column, its name is called "A1" then happed a program of company is not working,because it programs use Merge into method, let this program not run, until I add "A1" and Related code write into this Program.
This Program is C# Program.
Now, I will add a new column in the table B.
But my company has many program access in table B, and I don't know how many program access the table B...
So, how to do that, let me can advance find influenced program?
or
How to know which C# programs are using oracle operating table b ,
let me can get these programe name & path
Thinks!
Unless your code is inside the database itself (as stored procedures) there is nothing in oracle that can tell you. And since you said your code is in C#, that appears to be the case. This is where you have to rely an a search with whatever facilities are available in your source code control system.
I am not sure what do you mean by program here. But If you want to know which all PL/SQL objects are using TABLE_A then you can use the USER_DEPENDENCIES view as follows:
SELECT REFERENCED_OWNER,
NAME,
TYPE
FROM USER_DEPENDENCIES
WHERE REFERENCED_OWNER = 'SCHEMA_NAME_OF_TABLE_A'
AND REFERENCED_NAME = 'TABLE_A';
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I need to get diagram`s name of specific elements. Is it possible ?
I added elements note with specific stereotypu using profile to EA project. Then i want create a plugin where i find this notes and diagram names where they are located. (i want export notes and diagram names to excel)....PS: Sorry for my bad english
Issue a SQL like
Repository.SQLQuery("SELECT t_diagram.name FROM t_diagramobjects AS dobj INNER JOIN t_diagram ON dobj.diagram_id = t_diagram.diagram_id WHERE t_diagramobjects.Object_ID = <elementID>"
Just replace <elementID> with the element's elementID. You could alternatively retrieve the diagram GUID (t_diagram.ea_guid') and get the diagram details viaRepostory.GetDiagramByGUID`.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I work on a small project just to get to understand the mvvm model in C# better.
I work with a Microsoft SQL Server database with three tables: customer, location and address.
Every customer can have one or more locations, and every location has a specific address.
My current thought how to accomplish this:
First insert the customer.
To insert the location, get the highest customer_id and insert the location with the max(customer_id)
Then, to insert the address, get the max(location_id) and insert the address, with the location id
Is there a better way to do this?
I haven't found any tutorial with an example of inserting data into more than one table, especially not using SQL Server.
And my next problem is: what should I bind to my TextBoxes, so that I can insert the content of it?
I thought about having a save button. This button would then execute a method, where I insert the data from the bound TextBoxes. Should I do this with commands, instead of writing a method?
Thanks already!
Sql server has a OUTPUT clause which you can use
something like
INSERT INTO MyTable VALUES({CustomerName})
OUTPUT INSERTED.ID
then you can store the inserted customer's actual ID and do the rest inserts in separate queries.
As for your second question yes you should do it with Command binding to a method in your View model
The most advisable for your situation is to use a transaction.
Example.- https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction(v=vs.110).aspx
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to develop a form with asp.net Webform and would like to display in a ListBox or checkbox data from SQL Server. So I can call the elements of the table, there is no problem. But the worry is that I'd like to stored information that the user has selected / chosen the form in a different table because in the future I would like someone developer can not change the elements of the form without touching the code but just touch Sql server management Studio.
I hope you understand my problem ... Do you have a solution?
Thank you for your help :)
You can create a master table where all your master data resides. Ex. list of languages to be shown in Checkbox or Listbox.
And there will be another table which holds the user inputs usually referencing the Ids of master data along with other user inputs.
Ex.
Languages -> master table
-----------------------------
LanguageID
Name
UserDetails -> detail or actual table where you can store your user's inputs as well as the LanguageId from language table
-----------------------------
UserId
Name
City
LanguageID -> foreign key which reference of Language table
Hope this will help you.
I believe I understand what you're after.
Typically the way to do this is to have two tables in your database.
Options
- OptionID
- OptionName
// maybe an isactive flag?
Responses
- ResponseID
- OptionID
// maybe a username?
Your form then shows all the active options on the page. When a user comes along you create a response row where the OptionID is set to the ID of the option the user chose (with an appropriate foreign key).
Your developer can then add and deactivate options without removing users' responses.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I currently have a mysql data table that fills up when people complete a form. I then have my visual studio c# bot pull this data and do what I want. The table numbers the table using integers that increase by 1 each time. My bot looks in the table for id 1 and adds it.
The problem I have is that once my bot completes what someone wants and deletes the data, it does not recognize to go onto the next one since that id is not 1 and something else, like 2. I tried to have my c# bot add 1 to a variable each time and then have that variable represent the id so that every time the bot completed something it would go onto the next id. The problem with this was that every time the bot completed with one person the variable was reset back to 1. I am stuck now and can't figure out what to do. Any help would be great.
This is currently the string I use "select name from names where id = 1". If I can somehow instead of having the id = 1 and have it look for the next lowest id in my table then that would work.
Edit: Actually I think I figured out how to have the last added id be used. I will post it if I find it.
In MySQL, if you want the lowest ID then you could do something like this:
SELECT
Name
FROM
Names
ORDER BY ID
Limit 1
Is that what you are looking for?