.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

email to each record in gridview

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
I have a gridview that is populated from a selection made from a DropDown list box. I would like to click a check box then send an email to each record in the gridview. Could someone offer some solid help on how to do this?       Thank you for your input.

View Complete Post

More Related Resource Links

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

Gridview Edit on Searching of Record


using Asp.net c#

sql server

i am searching a record from my database and displaying it in gridview now i want the comments should be updated as per the record which is being searched

For E.g if record No.3 is searched then only i can update record no.3 and i don't want rest of data to be shown

now what is happening when i click on edit my whole table is being displayed

this is bcuz i made one method gridfill() which i m calling everytime if i m doing grid row editing,row cancelling and row updating

how i can resolve this thing

my code

 protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
        GridView2.EditIndex = e.NewEditIndex;


 protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
        string id = GridView2.Rows[e.RowIndex].Cells[0].Text;
        TextBox t;
        t = (TextBox)GridView2.Rows[e.RowIndex].Cells[2].Controls[0];
        string query = "update user1 set comments=@comments where id=@id";
        SqlConnection con = new SqlConnection(connstr);
        SqlCommand cmd = new SqlCommand(query, con);

Edit gridview record on 2 rows



Is that possible to edit a record within a gridview on 2 rows to make it look better when editing?

Like I have 8 columns in my gridview.

I wish to have 4 columns on row one and the 4 remaining columns on row 2.


Update Database Record using GridView and Stored Procedure

Hi, I am trying to update record via stored procedure, but i got error at very start point. Problem is when i click on Edit link button within the Gridview it produce error. I can populate values from database fine but its produce error when i click on edit link button. Please see the code below. *********** ASP.net GridView Code I am using *****************<asp:GridView ID="GridView1" runat="server" DataKeyNames="RollID, EmpID" AutoGenerateColumns="False" Width="700px"> <Columns> <asp:TemplateField HeaderText="ApplicationID" Visible="false"> <ItemTemplate> <asp:Label ID="AppsID" runat="server" Visible="false"><%# Eval("RollID") %>'</asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ReleaseID" Visible="false"> <ItemTemplate> <asp:Label ID="rlsID" runat="server" Visible="false"><%# Eval("EmpID") %></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Roll Name"> <ItemTemplate> <asp:Label ID="rlsVersion" runat="server"><%# Eval("Roll_Name")%></asp:Label> </ItemTemplate> <EditI

Reading each record from a text file and sending email

Hi All, I have a text file (CSV) which has only three fields (Name, Email, SendYN). I want to read each record from this text file and send email to those records where SendYN field has Y. I had created Flat File connection and a Flat File source in a data flow which uses Flat file connection. Now I stuck how to move further. Which control I need to add and where to identify whether SenderYN = Y and how to send email? I am new to SSIS. Thanks.

Possible to send an email if a record is added to a table?

I would like to be able to send an email notification if a website user inserts a new record in a table.  This will be a relatively rare occurrence so it would be very useful to have the notification as opposed to having my users check my summary page that lists all the IDs that have a record in this table. I googled but I must not be hitting on the right keywords or phrase to find the answer to this question. Thanks in advance for 1) letting me know if this is possible (I'm version ASP.NET 2.0 and using VB with a SQL Server database) and/or 2) pointing me in the right direction to find out how to do it if it is possible. Thanks! 

Print a specific Access Report with selected GridView record

I have my code output a gridview with all the data with an option to select records. I'm trying to make a code which would allow me to select a record, and then print this record using a specific Report stored in MS Access. I've located the code to print the Report it self, but it prints ether all the records or a range. Any ideas? 

Gridview Record Update Problum


How can I Edit and update record in Gridview using viserd..

in asp.net c#

Gridview updation of Record


i have bind griview dataSource with Store procedure having join of 3 table how can i update this gridview data using stored procedure?...

I am waitng...

Sending GridView in Email Message



How can I send GridView in Email Message.



Maximize page when new Record in GridView


Hi All,

I am trying to to maximize / focus the page when i get new record in my GridView, for this i put the timer to but i can i can see it is nit firing under the timer.

Here is my code.

function maximize() {
  window.moveTo(0, 0);
  window.resizeTo(screen.width, screen.height);

 Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick

	Me.ClientScript.RegisterStartupScript(Me.GetType(), "", "<script language=javascript>maximize();</script>")
        If GridView1.Rows.Count.ToString > Session("total_Row") Then
	     'Me.ClientScript.RegisterStartupScript(Me.GetType(), "", "<script language=javascript>maximize();</script>")
            Session("total_Row") = GridView1.Rows.Count.ToString
        End If

    End Sub

And i am calling RegisterStartupScript outside of timer for the example on push button event it works well. But inside timer it is not firing...

I will appriciate for your suggestions.


Selecting record based on domain url and email comparison


I want to limit the selecting of data records to only the user who created the record, OR a users who's email address belongs to the domain of the record being edited.
So, if the producer has a value in the URL of "www.mydomain.com" and their email address in the Membership is "someone@mydomain.com" they will be able to see the record.

I have the following table:
Table -  Producer
Field: ProducerID
Field: ItemUserID
Field: URL

I have figured out how to select based on the ItemUserID (see code below), but I don't know how to compair the email address values of URL and the Membership.

protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
      if (Page.User.Identity.IsAuthenticated)
     //get id of user logged in
     e.Command.Parameters["@ItemUserID"].Value = Membership.GetUser().ProviderUserKey;

Can someone show me how to code my requirements?

New Record Button for FormView when GridView on same form


I have a GridView and FormView on the same form - it all seems to work OK connected up together.

How can I offer the user a "New Record" button / link directly when they hit the page? At present it's only when they select a record from the grid that a New link appears.

Also on  a related note, if the user deletes a record, I have the grid refreshing, but the deleted record stays put on the formview - can I refresh this, or lose the formview until they select another record from the Grid?


How to hide a gridview when no new record entered


In my aspx page, I have a formview and a gridview. I am using the insert template of the form to insert an application number and applicant name both of which the user will enter.

I have a insert stored procedure that checks if that same number exist, it won't enter one, if not it will. ID of that table is autoincrement.

If a new number entered, it should show in the gridview as in my query I am asking to show the max ID. The applicatin number in the grid is a hyperlink which allows the user to go to a details page.

My problem: Whenever I click the save button in the formview, the grid becomes visible with the last created number. It is ok if the system allow to enter a new record. But if the number is a duplicate and the system does not enter a new number, still the grid shows with the last created number.

How can I implement what I want to do.

The stored procedure is:

ALTER PROCEDURE [dbo].[InsertNewChurchApp]nvarchar

Dropdown List in Gridview - While saving the record in gridview the droppdown selected index are cha



I am developing page for maintaing employee record using Visual Studio 2008, MS SQL server 2005.

I am able to fetch and display all the employee information in gridview, the gridview have the dropdown list to display the employee type [ Part Time, Full Time, Permanent , Contract ], in the item template i am having dropdown list. IN the dropdown list i am displaying this.

But While saving the record in gridview the droppdown selected index are changed to 0 of other dropdown list.

the user may be change the dropdown value from permanent to contract, or so. but while click on the save button in gridview, all the previous selection are gone, and always showing the first record of dropdown list. I know this is happening because we are doing dropdown list bind on onRowDataBound.

But i want to retain all the user selection in gridview, please help me how to do this.

thanks in advance.

Retreive A Label From Gridview Then Email It In HTML Form


I have a gridview with a button on the end of each row... When the button is clicked I need to access information on that specific row then send the information via email... So for example 1 row will have a binded label firstname "Chris", when the button is ticked for that row it needs to send the value "Chris" in an email... Im just wondering how this can be done?

Firstname label in gridview:

            <asp:Label ID="Firstnamelbl" runat="server" Text='<%# Eval("Firstname") %>'></asp:Label>

Button at the end of each row:

                    <asp:Button ID="Button1" Runat="server" Text="Send" OnClientClick="Button1_Click" />

Getting First record in Nextpage and last record of previous page of gridview



I am using paging to my  gridview (pagesize=4) . now i am in  (X) page and i want to get  (X+1) page top record or (X-1)page  bottom record , how i can get .


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend