I have a database with two tables in and I have created a dataset using both of the tables and created a query which is shown below...

SELECT Stock_Info.Stock_Symbol, Stock_Info.Company_Name, Stock_Info.FTSE_Sector, Stock_Info.Country_Of_Share_Register, Stock_Info.ISIN_Number,
Stock_Info.Stock, Price_Info.Stock_ID, Price_Info.Stock_Date, Price_Info.Price
Price_Info ON Stock_Info.Stock_Symbol = Price_Info.Stock_Symbol
WHERE (Stock_Info.Stock_Symbol = @Stock_Symbol)
ORDER BY Stock_Info.Stock_Symbol, Price_Info.Stock_Date DESC

and it works fine when I test it in the Query Builder, but then I created my WebMethod in my Web Service, which is this...


public void ViewPortfolio(string Stock_Symbol)


PortfolioDataSetTableAdapters.Stock_InfoTableAdapter portfolioTA =
new PortfolioDataSetTableAdapters.Stock_InfoTableAdapter();

if (!String.IsNullOrEmpty(Stock_Symbol))


and when I run my Web Service the WebMethod shows up as ViewPortfolio and I am able to click on it, but when I type in the Stock_Symbol the xml info that I want doesn't show up instead this text does...

System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
at System.Data.DataTable.EnableConstraints()
at System.Data.DataTable.set_EnforceConstraints(Boolean value)
at System.Data.DataTable.EndLoadData()
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at PortfolioDataSetTableAdapters.Stock_InfoTableAdapter.GetDataPortfolio(String Stock_Symbol) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\taskb\34b203b5\88af8b4e\App_Code.iu9j38-b.1.cs:line 998
at QueryWebService.ViewPortfolio(String Stock_Symbol) in e:\Application Development 3\Assignment 2\TaskB\App_Code\QueryWebService.cs:line 51

Can anybody please help me with this problem??

Thank You