473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DataSource. Please, need some help.

Hello,

I am using a LinqDataSource but I could either use an SQLDataSource or
any other. The question is the same:

The DataSource is associated with a GridView and I have the following
event:

' lds_Deleting
Private Sub lds_Deleting(ByVal sender As Object, ByVal e As
LinqDataSourceDeleteEventArgs) Handles lds.Deleting

End Sub

When I click a row in the GridView this event is fired.
I am creating a custom Linq code to delete a record but I need the
RecordId (PK) of the row clicked.

How can I get that value in my Deleting event?

Thanks,
Miguel
Nov 26 '07 #1
1 881

"shapper" <md*****@gmail.comwrote in message
news:93**********************************@f3g2000h sg.googlegroups.com...
Hello,

I am using a LinqDataSource but I could either use an SQLDataSource or
any other. The question is the same:

The DataSource is associated with a GridView and I have the following
event:

' lds_Deleting
Private Sub lds_Deleting(ByVal sender As Object, ByVal e As
LinqDataSourceDeleteEventArgs) Handles lds.Deleting

End Sub

When I click a row in the GridView this event is fired.
I am creating a custom Linq code to delete a record but I need the
RecordId (PK) of the row clicked.

How can I get that value in my Deleting event?
maybe this helps (example from the VS2008 docs):

Protected Sub LinqDataSource_Deleting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.LinqDataSourceDeleteEven tArgs)
Dim product As Product
product = CType(e.OriginalObject, Product)

If (product.OnSale And Not confirmCheckBox.Checked) Then
e.Cancel = True
End If
End Sub


Nov 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Chambers | last post by:
Hi all, I'm relatively new to JNDI concepts and need some help. I am writing a web app that accepts a variable specifying a jndi pooled connection datasource as a url variable. This is a...
6
by: WebBuilder451 | last post by:
I have a drop down list of saved searches for a user and i'm trying to use the datasource control to populate the ddl. The select value in the storedproc is the user.Identity.name. How can i use...
1
by: tomb | last post by:
This is making me crazy! vb.net 2003 I have two datagrids, datasource is the same datatable. I need the first one to show only 2 columns, the second to show 99 columns. They also have to be in...
2
by: Kelly | last post by:
I'm fairly new to ASP.NET2, but I have an ASP 3.0 background, and I've been experimenting with the DataSource and FormView widgets. I wound up having some questions along the way which I hope you...
0
by: Kevin | last post by:
Hi my name is Kevin can someone help me with the objectdatasource, when binding bussines objects to it ? i can normally bind them to a grid and detail grid but the problem remains that when the...
0
by: johnnyD | last post by:
I am creating a page which displays a customers billing history. As such it uses a datasource which queries the billing table. This works fine, and outputs desired information I need. I need the...
2
by: shapper | last post by:
Hello, I created a Repeater at runtime with an AccessDataSource.Everything Works fine! Now I need to use the same repeater but with a DataSource created in my VB.Net code. I created a...
0
by: Sylviarabi | last post by:
Hi I am wokrin on a website where i hav a grid view displaying data from an SQL table accordin to the customer chosen in the dropdown list in the update panel. This works fine but i am havin...
0
by: wildThought | last post by:
Heres the Deal, My DataSource is not reflecting a recent change to the object its based on. Steps: 1. Changed SQL Server Table 2. Regenerated my DAL(NetTiers) 3. Verified the...
4
by: remya1000 | last post by:
I'm using VB.NET 2003 windows application. i'm trying to display Crystal Reports using CrystalReportViewer. Code i'm using to display "ZTab.rpt" in CrystalReportViewer when Form_Load ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.