I have problem with LINQ. I have created SQL Server 2005 database Database.mdf in App_Data folder with two tables - Pages and PagesGroups. Table Pages consist of fields PageID, AspxForm, DescriptionEN, DescriptionPL, PagesGroupID, NavNameEN, NavNamePL, PageActive, NavToolTipEN, NavToolTipPL and table PagesGroups consist of PagesGroupID, NavGroupNameEN, NavGroupNamePL, NavGroupToolTipEN, NavGroupToolTipPL, GroupDescriptionPL, GroupDescriptionEN, GroupActive. I added example rows. I created DataClasses.dbml, where Pages is child of PagesGroups, and DataClasses.designer.cs, which cause error "No overload for method 'DataContext' takes '0' arguments", in App_Code folder. I started writing LINQ commands in master page (DataClassesDataContext db = new DataClassesDataContext(); var pages = from p in db.Pages select new { Description = p.PagesGroup.GroupDescriptionPL };). What should I write in DataClasses.designer.cs that errors does not occur? What is wrong in my DataClasses.designer.cs? I wrote source of DataClasses.designer.cs, MasterPage.master and error message below. App_Code/DataClasses.designer.cs:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.Linq; using System.Data.Linq.Mapping; using System.Linq; using System.Linq.Expressions;using System.Reflection;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="Database")] public partial class DataClassesDataContext : System.Data.Linq.DataContext { private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
public System.Data.Linq.Table<Page> Pages { get {return this.GetTable<Page>(); } } public System.Data.Linq.Table<PagesGroup> PagesGroups { get {return this.GetTable<PagesGroup>(); } } } [Table(Name="dbo.Pages")] public partial class Page : INotifyPropertyChanging, INotifyPropertyChanged {
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _PageID;
private string _AspxForm;
private string _DescriptionEN;
private string _DescriptionPL;
private int _PagesGroupID;
private string _NavNameEN;
private string _NavNamePL;
private bool _PageActive;
private string _NavToolTipEN;
private string _NavToolTipPL;
private EntityRef<PagesGroup> _PagesGroup;
public Page() { this._PagesGroup = default(EntityRef<PagesGroup>); }
[Column(Storage="_PageID", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] public int PageID { get { return this._PageID; } set { if ((this._PageID != value)) { this.SendPropertyChanging(); this._PageID = value; this.SendPropertyChanged("PageID"); } } }
[Column(Storage="_AspxForm", DbType="Char(10) NOT NULL", CanBeNull=false)] public string AspxForm { get { return this._AspxForm; } set { if ((this._AspxForm != value)) { this.SendPropertyChanging(); this._AspxForm = value; this.SendPropertyChanged("AspxForm"); } } }
[Column(Storage="_DescriptionEN", DbType="NText", UpdateCheck=UpdateCheck.Never)] public string DescriptionEN { get { return this._DescriptionEN; } set { if ((this._DescriptionEN != value)) { this.SendPropertyChanging(); this._DescriptionEN = value; this.SendPropertyChanged("DescriptionEN"); } } }
[Column(Storage="_DescriptionPL", DbType="NText", UpdateCheck=UpdateCheck.Never)] public string DescriptionPL { get { return this._DescriptionPL; } set { if ((this._DescriptionPL != value)) { this.SendPropertyChanging(); this._DescriptionPL = value; this.SendPropertyChanged("DescriptionPL"); } } }
[Column(Storage="_PagesGroupID", DbType="Int NOT NULL")] public int PagesGroupID { get { return this._PagesGroupID; } set { if ((this._PagesGroupID != value)) { if (this._PagesGroup.HasLoadedOrAssignedValue) { throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); } this.SendPropertyChanging(); this._PagesGroupID = value; this.SendPropertyChanged("PagesGroupID"); } } }
[Column(Storage="_NavNameEN", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] public string NavNameEN { get { return this._NavNameEN; } set { if ((this._NavNameEN != value)) { this.SendPropertyChanging(); this._NavNameEN = value; this.SendPropertyChanged("NavNameEN"); } } }
[Column(Storage="_NavNamePL", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] public string NavNamePL { get { return this._NavNamePL; } set { if ((this._NavNamePL != value)) { this.SendPropertyChanging(); this._NavNamePL = value; this.SendPropertyChanged("NavNamePL"); } } }
[Column(Storage="_PageActive", DbType="Bit NOT NULL")] public bool PageActive { get { return this._PageActive; } set { { this.OnPageActiveChanging(value); this.SendPropertyChanging(); this._PageActive = value; this.SendPropertyChanged("PageActive"); } } } private void OnPageActiveChanging(bool value) { throw new NotImplementedException(); }
[Column(Storage="_NavToolTipEN", DbType="NText", UpdateCheck=UpdateCheck.Never)] public string NavToolTipEN { get { return this._NavToolTipEN; } set { if ((this._NavToolTipEN != value)) { this.SendPropertyChanging(); this._NavToolTipEN = value; this.SendPropertyChanged("NavToolTipEN"); } } }
[Column(Storage="_NavToolTipPL", DbType="NText", UpdateCheck=UpdateCheck.Never)] public string NavToolTipPL { get { return this._NavToolTipPL; } set { if ((this._NavToolTipPL != value)) { this.SendPropertyChanging(); this._NavToolTipPL = value; this.SendPropertyChanged("NavToolTipPL"); } } }
... using System.Data.Linq; using System.Data.Linq.Mapping; using System.Globalization; using System.Linq; using System.Linq.Expressions;
... public partial class MasterPage : System.Web.UI.MasterPage {public void Page_Load(object sender, EventArgs e) { ... DataClassesDataContext db = new DataClassesDataContext(); ... if (Page.UICulture == "Polish") { ...var pages = from p in db.Pages where p.PagesGroup.GroupActive == true && p.PageActive == trueselect new { PagesGroupDescription = p.PagesGroup.GroupDescriptionPL }; } else {var pages = from p in db.Pages where p.PagesGroup.GroupActive == true && p.PageActive == true select new { PagesGroupDescription = p.PagesGroup.GroupDescriptionEN }; ... } ... } } Error:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1501: No overload for method 'DataContext' takes '0' argumentsc:UsersAdministratorDocumentsMy Web SitesKamil Szmit (szmitek)App_CodeDataClasses.designer.cs(25,22): error CS1501: No overload for method 'DataContext' takes '0' arguments c:WindowsassemblyGAC_MSILSystem.Data.Linq3.5.0.0__b77a5c561934e089System.Data.Linq.dll: (Location of symbol related to previous error)
Hello, I am designing a small databse example. The database only contains one table 'Employee'. Only five fields: EmployeeID(primary key), firstName,lastName,phoneNumber,Salary. Salary is an integer. Now I drag some buttons to the form. One button is to find employee by ID, find employee by last name and find all employees inside a certain salary range. My Table Adapter--Change the Update and Delete command to only need 1 parameter(primary key). But I get three compiling errors.
Error1No overload for method 'FillByEmployeeID' takes '2' arguments Error2No overload for method 'FillBylastName' takes '2' arguments Error3No overload for method 'FillBySalary' takes '2' arguments
Here is my codes
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace HUIDB { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'dataSet1.Employee' table. You can move, or remove it, as needed. this.employeeTableAdapter.Fill(this.dataSet1.Employee);
Hello, I want to get data from datatable as below. I am getting error: BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments. I did not understand what is wrong. Because everything is same as msdn library. my codebehind is: Imports System.Data Imports System.Data.Sql Imports System.Data.SqlClientPartial Class Default2 Inherits System.Web.UI.Page
Private Shared Function GetConnectionString() As String ' To avoid storing the connection string in your code, ' you can retrieve it from a configuration file. Return "Data Source=Database;Initial Catalog=otel;Integrated Security=True;Pooling=False" End FunctionProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadDim connectionString As String = _ GetConnectionString() ' Create a SqlConnection to the database.Using connection As SqlConnection = New SqlConnection(connectionString)
' Create a SqlDataAdapter for the Suppliers table.Dim mailsAdapter As SqlDataAdapter = _ New SqlDataAdapter() ' A table mapping names the DataTable.mailsAdapter.TableMappings.Add("Table", "Pages") connection.Open()Dim PagesCommand As SqlCommand = New SqlCommand( _"SELECT * FROM Pages", _ connection) PagesCommand.CommandType = CommandType.Text ' Set the SqlDataAdapter's SelectCommand. mailsAdapter.SelectCommand = PagesCommand ' Fill the DataSet. Dim dataSet1 As Dataset = New Dataset("Pages") 'ERROR MESSAGE HERE...........................................mailsAdapter.Fill(dataSet1) connection.Close()LblPageName.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(1)) TxtPageTitle.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(2))TxtPageSummary.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(3)) Rte1.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(4))TxtPageimgUrl.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(5)) End Using End Sub
Has there been any fix for this bug? The workaround in the KB article did not work for me and I cannot run my entire application from the Windows directory even if it did.
Please help.
Original Thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PageIndex=1&SiteID=1&PostID=274359
Workaround KB article: (I cannot run my app from Window directory) http://support.microsoft.com/kb/920272
Hi, I've got the error message below: "Error 80040E2F. A duplicate value cannot be inserted into a unique index [Table name=_SysRDASubscriptions, Constraint name=c_LocalTableName]"
I'm using SQL Server 2005 Compact Edition and still cannot solve the problem although the KB article (920272) said it is fixed in V3.1.
What I need to do is to drop a table and then Pull it again to the PDA but it gives me that error message during pull method. However, I can use the same process to drop and pull other tables and works fine. Will that be the problem related to primary key or to the data of the table?
I have an SqlDataSource control on my aspx page, this is connected to database by a built in procedure that returns a string dependent upon and ID passed in. I have the followinbg codewhich is not complet, I woiuld appriciate any help to produce the correct code for the code file Function GetCategoryName(ByVal ID As Integer) As String sdsCategoriesByID.SelectParameters("ID").Direction = Data.ParameterDirection.Input sdsCategoriesByID.SelectParameters.Item("ID").DefaultValue = 3 sdsCategoriesByID.Select() <<<< THIS LINE COMES UP WITH ERROR 1End Function ERROR AS FOLLOWS argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable
Help I have not got much more hair to loose Thanks Steve
"Procedure or function sptblTrgFACalculator_Insert_v2 has too many arguments specified"
This error was produced when i tried to insert 12 arguments into my table.Is there a limit to the number of arguments you can pass into your stored procedure?
Could some body in microsoft database team explain this behavior? Problem is predominant when cardinality of a column is very high and a where clause is specified on that column. Both use the same index.
I've found that I'm not the first one to get the error
"Procedure or function x has too many arguments specified"
while working with Stored Procedures (which is no surprise at all). But all suggested solutions didn't help, maybe this is because I misunderstood the whole concept. The situation is: On my page there is a FormView control including the EditItemTemplate. The database contains a Stored Procedure called UpdatePersonByID which is working fine as long as executed in Visual Web Developer. Here's the procedure code:
This is not exactly what it will finally have to do, of course the WHERE-clause later will contain an ID comparison. But since I tried to break down my code as much as possible I changed it to what you see right now. Here's the aspx-source (the red stuff is what I think is important):
And then once again a totally different question: Is there a way to post the highlighted aspx or vb code into this forum and keep the colors? i think I've seen that in some posts but didn't wanna do it manually.
Im currently using Access 2000 which is connected to a SQL database. I have a query (Or View) that runs every month. The problem i had was i had to manually make some changes every month to get to the data i needed so i changed this View into a Function with a parameter so i can input the detail(s) i need and it will run correctly - this works so far but the original View was also used within other queries that were created. Now the problem i have now is some of the other views that are now connected with the newly created Function comes up with the error:
ADO error: an insufficient number of arguments were supplied for the procedure or function Name_Of_Function.
I called the newly created function the exact name as the original view to ensure i had no problems. Any idea of whats happening here and how to resolve?
We have an application written in ASP that calls a MS-SQL stored procedure and passes several parameters. Once in a while, we get this error, but most of the time it works. We can also run this in SQL query analyzer without ever a problem. We've looked at the obvious and found nothing wrong.
Please help! Any suggestions are appreciated. (I posted this in ASP discussion board but no one replied)
Procedure or function sp_AddDealer has too many arguments specified. I am experiencing the 'too many arguments specified' error. I am running on SQL 2005. The Parameters lists on SQL server (when I view a dropdown under the sp name) shows a 'returns integer' (but without the @ the signifies a parameter).I have looked around the forums and haven't seen quite this flavor of this error. My forehead is sore from beating it against the wall... any clue would be appreciated! The error occurs when I click the 'new' link button, enter some data and then click the update link button after ... BOOM - Procedure or function sp_AddDealer has too many arguments specified. Thanks!! Chip Kigar Here is the stored Procedure:
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo ALTER PROCEDURE [dbo].[sp_AddDealer] @sCarcareSystem varchar(100), @sDealerName varchar(50), @sDealerPhysAddrStreet varchar(200), @sDealerPhysAddrCity varchar(100), @sDealerPhysAddrState varchar(10), @sDealerPhysAddrZip varchar(20), @nReturnCode bigint output, @nReturnId bigint output AS SET NOCOUNT ON DECLARE @m_nCt bigint SET @nReturnCode = 0 SET @nReturnId = 0 -- VALIDATE IF (@nReturnCode = 0) BEGIN SELECT @m_nCt = COUNT(tblDealers.[_DealerId]) FROM tblDealers WHERE [Dealer Name] = @sDealerName IF (@m_nCt >0) BEGIN SET @nReturnCode = -2000 --'Error for exsiting Dealer' SET @nReturnId = 0 END END -- PROCESS IF (@nReturnCode = 0) BEGIN SET @nReturnCode = -2 --' Error getting new record id' DECLARE @m_nNewRecId bigint SET @m_nNewRecId = 0 EXEC sp_GetNewRecId @m_nNewRecId output IF (@m_nNewRecId > 0) BEGIN SET @nReturnCode = -1 --'Error adding Dealer' INSERT INTO tblDealers ( [_DealerId], [Carcare System], [Dealer Name], [Dealer Phys Addr Street], [Dealer Phys Addr City], [Dealer Phys Addr State], [Dealer Phys Addr Zip] ) VALUES ( @m_nNewRecId, @sCarcareSystem, @sDealerName, @sDealerPhysAddrStreet, @sDealerPhysAddrCity, @sDealerPhysAddrState, @sDealerPhysAddrZip ) SET @nReturnCode = 0 --'Success' SET @nReturnId = @m_nNewRecId END END
Here is the SQLDataSource. I plugged the ID parameter, so I got a schema back, but no data.
Hi all, In Object Explorer of my ComputerNameSQLEXPRESS, I have a Database "shcDB" with Table "dbo.MyFriends" which has fields "PersonID" (Int), "FirstName", "LastName", "StreetAddress", "City", "State", "ZipCode", "E-MailAddress" set up. When I executed the following query: /////----shcSP-1.sql---//// USE shcDB GO EXEC sp_insertRecord 3, "Mary", "Smith", "789 New St.", "Chicago", "Illinos", "12345", "M_Smith@Yahoo.com" GO ///////////////////////////////////////////////////////////// I got the following error message: Msg 8144, Level 16, State 2, Procure sp_insertRecord, Line 0 Procedure or Function sp_insertRecord has too many arguments specified. (1) Why did I get this error? (2) Where can I get the documents for explaining the procedures like 'sp_insertRecord', 'sp_delecteRocord', 'sp_getRecord', 'sp_updateRecord', etc. and error messages? Please help and give me the answers for the above-mentioned questions.
Thanks in advance, Scott Chang
P. S. I used my PC at home to post the above message. I have not been able to post it by using my office PC in our LAN system. In my office LAN system, I have been struggling to figure out and solve the following strange thing: I log in http://forums.microsoft.com and "Sign Out" is on all the time. If I click on "Sign Out", I get "Logout: You have been successfully logged out of the the forums." page all the time. What is the cause to log me out? How can I get it resolved? Our Computer Administrator? Or Microsoft? What Department in Microsoft can help me to solve this problem? Please advise on this strange thing. Thanks.
An attempt to attach an auto-named database for file C:UsersCodeFreakDocumentsVisual Studio 2005WebSitesPersonalSiteApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I've tried allowing permissions I'VE EVEN TRIED ALLOWING EVERYONE! I've tried right clicking the datasource under the datasource explorer and clicking 'detatch.' It works Locally but fails when i pusblish with IIS. Whats with these SQL databases that just dont want to work with IIS 7 ?
Published with: IIS 7
I've tried removing the "user instance."
This is User roles and all that which uses SQL Server 2005.
So my question is, How do i publish a website with SQL Server 2005 database?
Please give it to me step by step as im still quite a newbie.
I'm trying to create a simple Data transfermation. I have a flat file that came of a unix server.. it's 177 bytes wide.. thought it was 175, but when I created the flat file connector, I could see some extra characters on the end.
My output is going to be an excel spreadsheet, I only want two columns from the input. I created an oledb jet 4.0 connection. and followed instructions from here :
On my first attempt to dataflow, I ran into unicode errors and had to do this:
ran into a problem with unicode errors. went to the source for the flat file. for the output column in question changed to Unicode string [DT_WSTR].
When I run , here are the errors I get:
[OLE DB Destination [513]] Error: An OLE DB error has occurred. Error code: 0x80040E09. [DTS.Pipeline]
Error: The ProcessInput method on component "OLE DB Destination" (513) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
[DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0202009.
[GanchoFileSource [1]] Information: The total number of data rows processed for file "\ammia01dev04D$JCPcpmgancho_venta_20070321.sal" is 19036.
[GanchoFileSource [1]] Error: Setting the end of rowset for the buffer failed with error code 0xC0047020.
[DTS.Pipeline] Error: The PrimeOutput method on component "GanchoFileSource" (1) returned error code 0xC0209017. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
[DTS.Pipeline] Error: Thread "SourceThread0" has exited with error code 0xC0047038.
I am trying to make a custom task. The custom task has one input, which i map to externalmetadata column in the task and one output.
When i run the task it fails with this error ( I am putting the whole SSIS message)
SSIS package "Package.dtsx" starting. Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning. Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning. Information: 0x40043006 at Data Flow Task, DTS.Pipeline: Prepare for Execute phase is beginning. Information: 0x40043007 at Data Flow Task, DTS.Pipeline: Pre-Execute phase is beginning. Information: 0x402090DC at Data Flow Task, Flat File Destination [1855]: The processing of file "C:ole db eft data.txt" has started. Information: 0x4004300C at Data Flow Task, DTS.Pipeline: Execute phase is beginning. Error: 0xC0047062 at Data Flow Task, Lib [2387]: System.ArgumentException: Value does not fall within the expected range. at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBuffer90.DirectRow(Int32 hRow, Int32 lOutputID) at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.DirectRow(Int32 outputID) at Lib1.LibPM.ProcessInput(Int32 inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper90 wrapper, Int32 inputID, IDTSBuffer90 pDTSBuffer, IntPtr bufferWirePacket) Error: 0xC0047022 at Data Flow Task, DTS.Pipeline: The ProcessInput method on component "Lib" (2387) failed with error code 0x80070057. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0x80070057. Error: 0xC0047039 at Data Flow Task, DTS.Pipeline: Thread "WorkThread1" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread1" has exited with error code 0xC0047039. Information: 0x40043008 at Data Flow Task, DTS.Pipeline: Post Execute phase is beginning. Information: 0x402090DD at Data Flow Task, Flat File Destination [1855]: The processing of file "C:ole db eft data.txt" has ended. Information: 0x40043009 at Data Flow Task, DTS.Pipeline: Cleanup phase is beginning. Information: 0x4004300B at Data Flow Task, DTS.Pipeline: "component "Flat File Destination" (1855)" wrote 0 rows. Task failed: Data Flow Task Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package.dtsx" finished: Failure. ----------------------------
This is my piece of code which is trying to put the data in the output buffer (ProcessInput function).
When I try to print a very simple report with rs2005 via the print button on the http://servername/report/pages/... website, it says "printing" but nothing happend. When I look at the server (win2003 SP1 + latest hotfixes) the www and sql2005 (SP1 CTP installed) services eat up 100% cpu for ever. I get no error messages neither in the rs log's nor in os application or system log. With profiler I found out, that there must be some loop. The following stored procedure exec DeletePersistedStreams @SessionID='24iumm55mp32l2ie2nezs0y0'is called about 650 times per second, which explain the load. The only way to stop this, is shut down and restart the www service. This behaviour can be found with all reports. The call, view and export of the same reports to pdf, xls, ... works without problems.
I have a Stored Procedure that has a query in it and it take 0 second and then a stored procedure that takes 16 seconds. From what I can tell they shoul be the same.
It doesn't recompile when i run the stored procedure, I checked that.
I have an File System Task that copies a file from one directory ot another. When I hard code the target directory (c:dirfile.txt) it works fine. When I change it to a virtual directory (\serverdirfile.txt) I get a security error:
[File System Task] Error: An error occurred with the following error message: "Access to the path '\gracehbtest oS2TMM_Live_Title_000002.xml' is denied.".
I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:
[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".
The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:
<?xml version="1.0" encoding="UTF-8"?> <ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>
There is only 1 ESDU root element and only 1 package element.
Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:
Hi,I am trying to write a method which needs to call a stored procedure and then needs to get the response of the stored procedure back to the variable i declared in the method. private string GetFromCode(string strWebVersionFromCode, string strWebVersionString) { //call stored procedure } strWebVersionFromCode = GetFromCode(strFromCode, "web_version"); // is the var which will store the response.how should I do this?Please assist.
Hi, I have application in which i am performing synchronization between SQL Server 2000 and SQL Server 2005 CE. I have one table "ItemMaster" in my database.There is no relationship with this table,it is standalone.I am updating its values from Windows Mobile Device.
I am performing below operations for that. Step : 1 Pull To Mobile
Code BlockmoSqlCeRemoteDataAccess.Pull("ItemMaster", "SELECT * FROM ItemMaster", lsConnectString,RdaTrackOption.TrackingOn);
Step : 2 Using one device form i am updating table "ItemMaster" table's values.
So i am getting an error on 3rd step. While i am trying to push it says, "The Push method returned one or more error rows. See the specified error table. [ Error table name = ]". I have tried it in different ways but still i am getting this error.
Note : Synchronization is working fine.There is not issue with my IIS,SQL CE & SQL Server 2k.
Can any one help me?I am trying for that since last 3 days.
Can someone help me with this issue? I am trying to update a record using a sp. The db table has an identity column. I seem to have set up everything correctly for Gridview and SqlDataSource but have no clue where my additional, phanton arguments are being generated. If I specify a custom statement rather than the stored procedure in the Data Source configuration wizard I have no problem. But if I use a stored procedure I keep getting the error "Procedure or function <sp name> has too many arguments specified." But thing is, I didn't specify too many parameters, I specified exactly the number of parameters there are. I read through some posts and saw that the gridview datakey fields are automatically passed as parameters, but when I eliminate the ID parameter from the sp, from the SqlDataSource parameters list, or from both (ID is the datakey field for the gridview) and pray that .net somehow knows which record to update -- I still get the error. I'd like a simple solution, please, as I'm really new to this. What is wrong with this picture? Thank you very much for any light you can shed on this.
I'm using parameters to record into database like: SqlParameter paramId_empresa = new SqlParameter("@Id_empresa", SqlDbType.Int, 4); paramId_empresa.Value = idEmpresa; myCommand.Parameters.Add(paramId_empresa); And set sql server field to allow null values and default value as (null) Trouble is I'm getting an Input string was not in a correct format. when the field is blank Line 182:Line 183: myConnection.Open();Line 184: myCommand.ExecuteNonQuery();Line 185: myConnection.Close();Line 186: }
I am unable to set the value of my SqlParameter unless it is to a string.sqlCmd.Parameters.Add('@myParameter', SqlDbType.Bit).Value := false; Setting it to false or 0 results in error: "Incompatible types: 'Object' and 'Boolean' (or 'Integer')" I've tried to cast them as objects and that didn't work. I don't understand why something like 'false' (as a string) will. FYI: I'm using Delphi.NET and hating it.
Im trying to execute the following:mySqlCmd.Parameters.Add("@Parent_ID", SqlDbType.Int).Value = (sectionUpdate.iSection.ParentID == 0 ? DBNull.Value : myParentID); However i get an error that Null cant be converted to Int. Is there any way i can uyse the SqlParameters approach but pass in a Null value for the field or must i wrap the entire connection within a IF/ELSE statement one containing a hard-coded NULL within the query and the other as a standard parameter with a proper int value? Thanks
Hi I am writing an app in flash which needs to hook up to MS SQL via asp.I need the code below to pass the var (ptodaysDate) to the sql statement. I can hard code it in and it works great but I really need to pass the var from flash.Pulling my hair out here, not much left to go.Any help greatly appreciated.---------------------------------------------- [WebMethod] public Schedule[] getSchedule(int ptodaysDate) { SqlDataAdapter adpt = new SqlDataAdapter("SELECT scheduleID, roomName, eventType,unitName,groupName,staffName,staffName2,theDate,theEnd FROM tb_schedule Where theDate >= @rtodaysDate", connString); SqlParameter rtodaysDate = new SqlParameter("@rtodaysDate", ptodaysDate); DataSet ds = new DataSet(); ArrayList al = new ArrayList(); adpt.Fill(ds); foreach (DataRow row in ds.Tables[0].Rows) { Schedule obj = new Schedule(); obj.scheduleID = (int)row["scheduleID"]; obj.roomName = (string)row["roomName"]; obj.eventType = (string)row["eventType"]; obj.unitName = (string)row["unitName"]; obj.groupName = (string)row["groupName"]; obj.staffName = (string)row["staffName"]; obj.staffName2 = (string)row["staffName2"]; obj.theDate = (string)row["theDate"]; obj.theEnd = (string)row["theEnd"]; al.Add(obj); } Schedule[] outArray = (Schedule[])al.ToArray(typeof(Schedule)); return outArray; } public class Schedule { public int scheduleID; public string roomName; public string eventType; public string unitName; public string groupName; public string staffName; public string staffName2; public string theDate; public string theEnd; }
The FULL System.Data.SqlDbType reference seems unnecessary? Is there something I am doing wrong or something that should be added to Web.Config? If I try ONLY ",SqlDbType," it will not compile?
MY CODE: SqlParameter AName; AName = myCommand.Parameters.Add("@AName",System.Data.SqlDbType.VarChar,50);
The SqlParameter with ParameterName '@pk' is already contained by another SqlParameterCollection
If I could work out what code to post I would, but I can say that I am managing my Sql data in my code by caching small arrays of SqlParameter objects as pulled from the database. If I need to update the DB I change the cached SqlParameter and re-insert it. If I perform a SELECT I check the cache first to see if I already have the SqlParameter. However, currently, I am experiencing the above error when performing a select, then later an update, followed by another update. Would I be correct in saying that a SqlParameter object can only be used once for a database operation and should be discarded? Would I be correct if I said that the SqlCommand object should be discarded? I am barking up the wrong tree entirely?
Is it possible to have a SqlParameter setup as an Output, and get it to return @@Identity without using a stored procedure?
I have an INSERT statement, written as TEXT in my code (at the time being, I cannot create stored procedures). I'm trying to find out how to return the created IDENTITY that was generated.
Can someone please explain to me how this works? Thanks.