Forms Data Controls :: Gridview Editing With SQL Datasource And Stored Procedures?

May 26, 2010

I was reviewing my old post about this issue with a accessdatasource and that was simple since the Select, Update and Delete were all written within the datasource.

But this page im having issues with is using SQLDataSource and pointing to Store procedures. My issue is that i have created the sqldatasource with Insert(storeprocedure), Select(actual select statement), Update(storeprocedure) and was trying to take advantage of gridviews capabilities for editing when connected to a datasource that has all those elements setup.

Here is my datasource and gridview code: The gridview row goes into edit mode, but the changes never take affect on the database.

[Code]....

View 1 Replies


Similar Messages:

DataSource Controls :: Stored Procedures Are Not Showing Up Correctly In The Stored Procedure Drop Down

Apr 27, 2010

I am using Visual Studio 2008 and SQL Server 2008 and have added a SQL datasource to my form.

When I configure the datasource, I choose my connection string which looks like this in my webconfig:

<connectionStrings>

<add
name="PSFSPRD_ConnectionString"
connectionString="Data

The database I am using has a schema called EQB and as such, my stored procedures are named as EQB.usp_SelectFunds, EQB.usp_SelectAccount, etc.

On the select tab of the Configure Data Source screen, I choose to use a stored procedure. The dropdown shows my stored procedures, however, the schema name does not show up in front of the stored procedures in the drop down. I see only usp_SelectFunds, usp_SelectAccount, etc.

I select one of the stored procedures and when I click TEST, I get the message that the stored procedure is not found. If I instead choose to use a SQL statement instead on the configuration screen and enter EXEC EQB.usp_SelectFunds and click TEST, it works fine.

Why are my stored procedures not showing up correctly in the stored procedure drop down and how can I fix this?

View 3 Replies

Forms Data Controls :: Delete Gridview Row Using Stored Procedures And Pass Parameters

Jan 8, 2011

i have a gridview and the delete option.

when i press delete button i want to run my stored procedure which requires an input variable. how can i do this?

View 1 Replies

DataSource Controls :: LINQ With Stored Procedures?

Mar 29, 2010

Im new to ASP.NET (Normally use PHP), and im currently designing a website in VB.NET and SQL Server.

When using LINQ to SQL i know that it uses parametarized queries and we dont need to add them.

So do we need to use Stored Procedures in LINQ (for security reasons)???, If yes How

View 3 Replies

DataSource Controls :: Encrypt All Stored Procedures At Once?

May 7, 2010

How can I encrypt all Stored Procedures of a database at once?

View 3 Replies

DataSource Controls :: Do Stored Procedures Execute Locally

Apr 10, 2010

we have sql server running on a server.

when person A connects to sql server from their machine and executes a stored procedure (a stored procedure which runs a query and sends an email) - it executes and the email is received.

when person B connects to sql server from their machine and executes the same stored procedure, it executes but the email is never received.

does this mean the stored procedure is executing locally on both users machines?

if not....then why does person B's execution of the stored procedure not generate the email?

View 2 Replies

DataSource Controls :: How To Write And Use Dynamic Stored Procedures In C#

May 28, 2010

I want to write dynamic store procedure means 1 select_sp, 1 update_sp, 1 insert_sp, 1_delete_sp for all tables.

How it is used in secured manner.

View 2 Replies

DataSource Controls :: What Is The Best Method To Log Executed Stored Procedures

Apr 6, 2010

Should I just write to file before a stored procedure is executed or should I log the stored procedure into a table? If the latter one is recommended, how should I go about doing that?

View 4 Replies

DataSource Controls :: Sqldatasoure, Mysqldatareader And Stored Procedures?

Jan 8, 2010

I am having a problem returning a value from a stored procedure when using SqlDataSource. The stored procedure is executing because 'invoice_no is incrementing but Myreader.HasRows is always false.

Here is the table definition

`invoice_no` int(10) NOT NULL AUTO_INCREMENT,
`employee` varchar(50) DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`invoice_no`)

Here is the stored procedure:

CREATE PROCEDURE `GetInvoiceNumber`(IN username VARCHAR(50), OUT InvoiceNum INT)
BEGIN
INSERT INTO invoice (employee)
VALUES (username);
SELECT MAX(invoice_no) INTO InvoiceNum FROM invoice;
END

And here is my code.

[Code]....

View 2 Replies

DataSource Controls :: Use Stored Procedures From LINQ With A Using Clause ?

May 25, 2010

Ive created a new LINQ To SQL class and dragged several tables across from my server, in my code I access them like this

[Code]....this is all ok, however, I have several stored procedures that I want to use as well, but when I drag the stored procedures across I get a compilatiopn error

Error 60 'DB_BL.DB_BLDataContext': type used in a using statement must be implicitly convertible to 'System.IDisposable'

how do I use stored procedures from LINQ with a using clause ?

View 7 Replies

DataSource Controls :: Can Create Overloaded Stored Procedures

Jan 6, 2010

can we create overloaded stored procedures in sql server

View 7 Replies

DataSource Controls :: Create Stored Procedures Using Vbscript?

May 12, 2010

how to create stored procedures using vbscript, and how to pass the parameters to the stored procedures...

View 6 Replies

DataSource Controls :: SqlDataSource How To Change The Stored Procedures At Run Time

Aug 18, 2010

Is it possible to change the select, insert and update stored procedure of an SqlDataSource at run time. I don't mean to change the definition of the stored procedure, but I mean to change the assignment, i.e. To change the select stored procedure from "selectSP1" to "selectSP2" at run time. Is it possible?

View 4 Replies

DataSource Controls :: Executing Two Stored Procedures That Either Pass Together Or Fail Together?

Mar 2, 2010

I open a sqlconnection and sqlcommand. I execute a stored procedure and get the scope_identity from that procedure to be used within another procedure that needs to be fired. Unfortuntley if the second procedure fails forwhatever reason the data change for the first procedure commits anyway. I kind of want to do a began transaction end transaction on the c#.net side. Also I need to execute a stored procedure multiple times....

View 2 Replies

DataSource Controls :: Using Sql Stored Procedures - Does Linq Still Make Sense?

Jan 4, 2010

If this is not the appropriate forum for this I didn't see any linq specific forum listed.

I am about to start a new project and I would like to use it as an opportunity to update myself with the newer technologies, like ajax and linq.


All my database CRUD operations will be done by sql stored procedures, does linq still make sense when doing that? I watched a couple introductory videos on linq and none of them dealt with stored procedures, thats why I'm wondering.

View 10 Replies

DataSource Controls :: Good Way To Use Linq With Update Stored Procedures?

Jun 9, 2010

I like to use my own stored procs as much as possible.

That way I know exactly what's happening and I can explain and control things.

I'm using stored procs with LINQ to SQL for CRUD operations.

For select, insert and delete - using stored procs with LINQ to SQL is pretty straightforward.

However, if I want to use my own custom stored procs with L2S for updates what's the best way to accomplish this?

Can you provide some code that shows the best approach that you would personally choose for this?

View 1 Replies

DataSource Controls :: How To Execute 3 Stored Procedures On Page Load

Mar 30, 2010

In a pickel here. When I run this code:

[code]...

The only Stored procedure execute is the last one TSD_UpdateTimeCardEndofDay

View 3 Replies

DataSource Controls :: Errors In Passing Values To Stored Procedures?

Jul 28, 2010

I am passing values from textboxes on the webform to my stored procedures where it should insert values passed.

It is giving an error like Cannot implicitly convert type 'string' to 'System.Data.SqlClient.SqlParameter' at place where I am cmdselect.Parameters.Add("@PackageName", SqlDbType.VarChar, 50) = PN; where PN is string type .

View 2 Replies

DataSource Controls :: LINQ Using Stored Procedures And MvcContrib Grid With Pagination?

Jan 12, 2010

I have been chasing this erorr all day and coming up blank. I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.

It generated this:

[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")]
public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId);
return ((ISingleResult<ServiceTemplate>)(result.ReturnValue));
}

I call it from my service with the following method:

public ISingleResult<ServiceTemplate> GetByFkId(int FkId)
{
return Db.usp_ServiceTemplateSelectByFkId(FkId);
}

I have tested the stored procedure and it returns the results I want. When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times).

In addition, in my controller code, I am using the MVCContrib ToPagedList() method which doesn't appear to work with the ISingleResult interface (forward only cursor, I'm guessing). I have attempted converting the service results to IQuery, List, and Array, however, I still have the problem with the first record being repeated 4 times.

View 3 Replies

DataSource Controls :: Prevent Server/Database To Have SQL Stored Procedures Encrypted?

May 13, 2010

I have access to two servers, one with my development database on, and another with the live database on.

All SQL Stored Procedures, Functions, Views are encrypted on the live database (using WITH ENCRYPTION in my query)

However I'm concerned I might accidentally encrypt a bunch of SProcs on my development database meaning I can no longer view/edit that code.

I have full control over the server and database, and was wondering if there is a way I can prevent these from being encrypted, therefore throwing up an error when this is attempted?

View 4 Replies

DataSource Controls :: Stored Procedures & SqlDataAdapter Not Updating A Calendar Control?

Aug 24, 2010

I have a database linked to a calendar. I had a peice of code that retrieved dates from a database and populated the calendar. I wanted to tidy up my code using stored procedures (they seem neater & i assume there's a benefit somewhere). so i came up with this, however it's not working. The calendar displays, but it's not being populated with the database entries. The SqlCommand & SqlParameter I have working elsewhere in my code; as with the SqlDataAdapter (which also worked before i tried to conver to a storedprocedure!) but combining these three (SqlCommand, SqlParameter & SqlDataAdapter) seem to be causing me problems.It's probably something stupid but if someone could take a look and point me in the right direction,

[Code]....

[Code]....

View 2 Replies

Forms Data Controls :: Call The Stored Procedures Dynamically?

Oct 18, 2010

ringht now i am working with one web page, in that page i have 3 sections of data [or 3 set of data] in 1 set 4 to 5 fields actions to be taken when we click on save button 1st it should save the 1st fields data in one of my sp and it should get the table level id it should loop that table level id into another set of records & insert into to the another sp

View 4 Replies

Forms Data Controls :: Binding To Multiple Stored Procedures?

Jan 16, 2011

I have a situation where in a legacy app (VB6) I have a grid which is populated by any one of a large number of (100+) stored procedures. Each of the procedures returns one or more rows with an identical list of columns (including column names, column data types, column order). I am basically looking at the (best) options to keep things reasonably light weight. Each procedure has its own set of parameters, each of which would result in different query plans etc. I have tried using each query to exec select into a (temp) table which is encapsulated into a "master" query which then returns a single results set, but it breaks SQL, the query optimiser returns an infinite number of rows - this is a MS documented issue. Looking for possible ways forward: generics, model view etc

View 3 Replies

Forms Data Controls :: DataSet With Stored Procedures (3 Selects Statements)

Dec 23, 2010

This is my stored procedures with 3 selects statements
[Code]....

Now I have to fill two dropdown from the forst 2 select statements and need to fill some label through the 3 statement for this I did this
[Code]....

Its working fine my
[Code]....

Now I want to bind others controls. But I am not getting that how dataset differentiate which data need to bind to which control. How I can do this.

View 5 Replies

Forms Data Controls :: Use All The Built - In Editing Functionality Of A GridView Without Setting A DataSource?

Jan 6, 2010

I would prefer that all middle tier methods that are used by GridViews be in the form that allows them to be used by ObjectDataSources...

<DataObjectMethod(DataObjectMethodType.Delete)> _

However, I am working on a project that I did not create. So, I was wondering if there is a way to use all the cool built-in editing functionality of a GridView without setting a DataSource? In other words, I am binding the datasource in the code behind (this works), and I have the following in my GridView...

<asp:CommandField ShowEditButton="True"></asp:CommandField>

And in the RowUpdating event (after the update button is clicked), I would like to call a stored proc to update a table and then use this kludge to get the GridView out of "edit" mode...

e.Cancel = True
grdWeeklyTime.EditIndex = -1
grdWeeklyTime.DataBind()

Is this possible or do I absolutely need to specify a DataSource in the GridView dropdown in design mode and then check the Enable Editing checkbox?

View 2 Replies







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