SQL Server :: One To Many Relationship Entry Using SP?

Mar 17, 2011

i m developing an inventory module in which i have a GRN(Goods Received Note) form, the user opens the form and enter the items which are coming from itemMaster table. I want to add the grn entry in a table named GRN and all its respective item details in other table and also want to update the instock quantity in item Master table. how can i achive this there are multiple items in a grid in grn form which are to be stored in a table and only 1entry of grn in grn table and also update the instock Qty in the itemMaster Table,,...i ned write my logic using Stored procedures and ADO.NET i m totally confused

View 1 Replies


Similar Messages:

SQL Server :: Relationship Which Allows NULL Entry / Error 'FK_Table_Contracts_Table2_PONo' On Table 'Table_Contracts'?

Nov 29, 2010

I have two tables as below.

I tried to establish a relation between two tables in such a way that Table_Contracts will still accept NULL values for [PO_No], but [PO_No] on TableContract will be automatically updated when [PO_No] on Table2_PONo changed. Moreover, if you want to delete a record on Table2_PONo, it needs to be stopped if there is a related data in Table_Contracts.

I set a relation with these parameters:

Check existing data on creation or re-enabling>
No

Enforce for replication>
No

Enforce foreign key constraint>
No

Delete Rule>
No Action

Update Rule>
Cascade

I got this error

Introducing FOREIGN KEY constraint 'FK_Table_Contracts_Table2_PONo' on table 'Table_Contracts' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.

Table2_PONo
[PO_No]
(primary key)
[Project_ID]
[SupplierID]
[Description]
[TotalPrice]
[PO_Currency]
[VATpercent]
[CostCode]
[Notes]
[PO_Date]
[Reality]
[UpdatedBy]
[FromAccess]
Table_Contracts
[ContractID]
[ProjectID]
[PO_No]
(accepts null values)
[ContractNo]
[ContractDate]
[ContractValue_woVAT]
[ContractCurrency]
[SupplierID]
[ContractDescription]
[ContractType]
[LinkToTemplatefile_DOC]
[SentToSupplier]
[SignBySupplier]
[SignByMercury]
[CollectionBySupplier]
[LinkToPDFcopy]
[ArchivedByMercury]
[UpdatedBy]
[Retention]
[Note]

View 2 Replies

SQL Server :: How To Create Relationship Between Two Tables

Dec 17, 2010

i am working with multiple table with some same columns, so here i want to use the concept of primary key and foreign key.primary key is very easy to put on any fields but, i dont know how to give foreign key and how to create relationship between same fields of two table.

View 2 Replies

SQL Server :: How To Set Relationship Profile With Tbl_domain

Mar 18, 2011

I've used aspnet_Profile and I add new values​​. In the field "PropertyNames" I added value "DomainId". In the field "PropertyValuesStrings" I added value I get from the table "tbl_Domain.

How do I connect aspnet_profile table, column "PropertyValuesStrings"with tbl_Domain, column 'Id' primary key.

View 1 Replies

SQL Server :: Adding A Relationship - Nvarchar(256) Doesn’t Match

Jan 22, 2011

The following datatype or size property of <Tablename>.<Columnname> doesn't match <Tablename>.<Columnname>. When creating a foreign key relationship, the data types and other properties of selected columns must match. Select a column with the same data types and other properties as the related column. The properties that must match are Data type, Length, Precision, Scale, and Collation.

I am trying to add a constraint to my database and I keep get the above error. I can find Data type, length, and Collation in the properties. What are precision and scale in this context. I don't see such settings. Specifically I am trying to add a relationship from the aspnet_Membership table to a table that I added. I have put a relationship on aspnet_Users.UserName to another table, so I am baffeled.

View 1 Replies

SQL Server :: Create A Relationship Between Database Table And Xml File?

Mar 17, 2011

I've just taken over looking after a website and well to be honest the way it's been put together is not the best, but I have to make do as the client does not have the money to make major changes.Anyway currently there is data stored in a MsSQL database and some in an XML file. The xml file does have a ContentID attribute which matches the ContentID in a table.Not really done much with XML as I tend to use a database and LINQ.What would be the best way to tie these two together so I could output the results in a gridview for example.

View 2 Replies

SQL Server :: Setting Last Entry Of A Db To A Textbox?

Jan 25, 2011

When i click a button i want to be able to select the last entry in the db and set it to to a text box

this is my code

con.Open();
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select Top 1 Teacher_ID from Teachers order by Teacher_ID Desc";
SqlDataReader reader = cmd.ExecuteReader();
IDTXT.Text = cmd.CommandText;
reader.Close();
cmd.ExecuteNonQuery();
con.Close();

As ya can see i can only set the text equal to the statement and not the return value

View 2 Replies

SQL Server :: Adding An Image To Database Entry?

Aug 11, 2010

is there a way to add an image in SQL server database entry

say i got an colonm name [carmodel] in Sql Server and in that colomn name i got Toyota Supra can i attach an image to that Dataentry and how to ?

View 2 Replies

SQL Server :: How To Identify Ip Address Uniquely With One Entry At A Time

Mar 26, 2011

As working with ip address in Sql Server needs some Efforts than mysql b'cos it Doesn't has INET_ATON() functionality. even though we create a Function to do that. But as per Requirement if ip address and postid should be Unique with One Post Question. than its some more complex to implement. so i need a solution without compromising my Disk space, 4 Tiny int field for ip address can be used but comparison will be more Hard to achieve. b'cos it is a composite primary key.

View 2 Replies

SQL Server :: Returning A Certain Number Of Characters From A Database Entry

Feb 17, 2011

I have an entry from a database that has 500 characters. But when i display it i only want to return 200 charcters. How do I do that. I use Sql Server.

View 3 Replies

SQL Server :: Delete Entry Directly In Any Aspnet_* Table?

Jul 29, 2010

if It is okay to delete entry directly in any aspnet_* table ? because i screwed something.

View 3 Replies

MVC :: The Form Is Submitted, The Server Side Validation Trips And I'm Told The Entry Is Invalid?

Jun 27, 2010

I've got my validation wired up through my Service layer, and my Birthdate property looks like this.

[Code]....

The client side validation works properly if I input something like `12/12/1990` but when the form is submitted, the server side validation trips and I'm told the entry is invalid. I'm using the jQuery-UI Datepicker to input the date, however when I disable the datepicker, the problem persists.Am I missing something here? I thought the client side and server side would be the same thing.If I remove

[Code]....

Then the form submits. It's obviously something to do with the Regex.

View 8 Replies

VS 2008 - No Error Is Generated And No Entry Is Logged In Windows Event Viewer On Server

Sep 9, 2011

i made an upgrade to an existing application (still developed by me), while testing on my development machine, everything worked fine. After migrating to a Test Server(windows 2003 server), users can not test the application, it periodically crashes their session and redirected them to the login page (Forms Authentication). No error is generated and no entry is logged in the windows event veiwer on the server. I also noticed this also happens when they try to access a particular page in the application.

The page contains 50 instance of a user-control. Each of the user-control contains 8 textboxes, 2 labels,1 hidden field and 12 asp.net validation controls. I tried saving a copy of this page from Internet explorer (IE8) on my development machine,its about 2.2MB in size.What may be wrong and what tracing tools can i use on my development machine (since it generates no errors). How can i also reduce the size of the page (noting that the asp.net validation controls generated alot of HTML codes)

View 4 Replies

SQL Server :: How To Check (true/false) If Every Single Entry In Table Exists In Other Table

Oct 15, 2010

I have 2 tables:

- Salesmen with Pk.SalesmenID
- Appointments with Fk.SalesmenID and busy(bit)

How can I check if every salesmen has at least one appointment

Am I on the right way with statement below, though I got syntax problems

[Code]....

View 5 Replies

SQL Server :: Adding A Bunch Of New Records To The English Table / Repeating The Data Entry Into The Spanish Table

Oct 29, 2010

I have two tables for storing language translations - tblEN and tblES. They have the same structure which is nvcEnglish and nvcLocal - both nVarChar fields.

In nvcLocal of the Spanish table, I enter the Spanish translations of words and phrases used within my app. Problem is, when I add a bunch of new records to the English table I also have to go in and repeat the data entry into the Spanish table. I am wondering if there is a way to import the newly added records into the Spanish table using Transact SQL?The plain language query would be something like:

If the data in tblEN.nvcEnglish does not exist in tblES.nvcEnglish then insert a new row into tblES with the values from tblEN

View 5 Replies

C# - How To Set Relationship Of Users

Apr 2, 2011

need Users to be able to be friends with other Users (Users are kept in the User table) im trying to create a "Friends" table so they can relate to one another.I need the UserID stored along with FriendID, UserID is of the current user and FriendID is related to the UserID of the friend. ARGh so confusing. Im getting lost even talking about it again, basically the way ive written my code i need the FriendID to relate to the UserID of the user table so i can find the person im after so I can display there credentials on the current "UserID" page but I also need some way to find out all the current UserIDs friends

View 1 Replies

Access :: One To Many Relationship Between Columns

Mar 31, 2010

I have a table Structure

filename AKA
12-3-09.pdf 443567
12-3-09.pdf 345678
12-3-09.pdf 456789
3-3-10.pdf 78901
filename AKA

I want to output as 12-3-09.pdf 443567,345678,456789 3-3-10.pdf 78901.

View 20 Replies

ADO.NET :: Editing Entities In M - N Relationship?

Feb 19, 2011

I make ASP.NET MVC3 application for spa and I've encoutered problem with M:N relationship. I've got this model Each Insurance Company has different pricing for each patient medical indication, so sample data looks like this:

IC
Indication
Patient
IC1
Indication1
Patient1
Patient2
Indication2
Patient3

[Code]....

And I don't know how to make Edit with possibility of changing not only Indication but IC to.

View 1 Replies

Relationship Between Razor And Aspx?

Feb 26, 2011

There have been several similiar questions but I am still confused. Take the following code as example:

<% Html.RenderAction("partial"); %>

@{Html.RenderAction("partial");}

the aspx page runs well but Razor throw an error: "No route in the route table matches the supplied values." And even this is wrong, too.

Html.RenderAction("partial");

So why? What's the "@" really mean? What's the difference or relationship between aspx and cshtml?

View 1 Replies

Function Of Code In 2 Files And Relationship?

Jan 14, 2010

the developer who wrote this code is no longer with us and there are absolutely no comments whatsoever for us to know whats happening. Me and my other co-worker are just learning .net and hence not that much experts. can some one please tell us what the code does in both the files below and how they are related to each other ( we are very +VE that they both are related) first file. its called products.aspx. the code is below

[Code]....

View 6 Replies

Application Domain Vs Thread - Relationship?

Mar 29, 2010

Can someone explain me what is is the relationship between App Domain and thread? msdn says "threads are free to cross application domain boundaries; a new thread is not created for each application domain." suppose there is one thread t inside Appdomain a1 .there is an another App domain a2 .thread t can cross to a2 from a1 means it can access a2 memory area If thread can cross the app domain boundaries share the memory space then how application domain isolation is still there?

View 5 Replies

How To Use Persistence To Maintain State / Relationship

Nov 29, 2010

I have to create a very simple database driven website ( for a project ) with basic features like a login system, etc. I have completed most of the basic tasks required, but there is one section that is asking me to 'Use persistence to maintain state/relationship'.

I have read a few articles and videos about persistence but I don't understand its benefits and why and how it should be used. Can anyone point me towards a site that explains how to implement state persistence in a simple way. I don't need anything advanced just a very simple way of integrating this into a very simple site to say its been done.

View 1 Replies

Writing To A Relationship Based Table?

Feb 15, 2010

I think I'm just after advice on best practice with this! I have a database which has 2 tables. The first table has ID, Name, Address and the second table has ID and JobType. Table 02 can list multiple types of JobType so we could have

Table01:

1. D Smith. Address01
2. S.Jones. Address02

Table02

1. Accounts
1. Sales Ledger
1. Chartered Accountant
2. IT
2. Web Design
2. Graphic Design
2. 1st line support

A join gets them together and all works perfectly.However, the content will be updated when some one fills in a web form. Do get the form to send results to both tables, I assume I have to open the database twice or can I open it once and open each table one at a time? I know I could practice this and not ask the question but I am interested to know what is the most efficient way. I would also need to know what ID to use. So when I populate Table02 it uses the correct ID from Table01. At the moment Table01 ID field is incremented automatically. Would you suggest I always assign the ID myself, or would I need to query the database, find out what ID number is currently in use and then increment it by 1 and assign the new number to an ID variable which then populates the Table's Field? In which case, am I opening the database again or trying to perform all 2/3 stages in one go?

View 3 Replies

MVC :: Displaying Data From Two Tables That Have A Relationship?

Dec 28, 2010

I want to display details STRONGLY TYPE In a view this would be done as normal through the list, hiting the details link. however a table of notes is connected to the main table of info. i want to us the id of the main table item to list all the notes that have been entered about the record in the main table. how do i do this

View 1 Replies

Relationship Between Assemblies, Namespaces And Classes?

Apr 13, 2010

I'm trying to understand the relationship between assemblies, namespaces and classes. Can anyone help explain or point me to a usefule link?

1. I understand that an assembly is typicall a dll or an exe (perhaps other files also). Does each project compilation produce only 1 dll? Or is the number of DLL dictated by something completely different?

2. I read each assembly can contain multiple classes. Asingle assembly can contain classes for multiple namespaces, and asingle namespace can span multiple assemblies.

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved