Datagrid No Data Show While Sp Run Has Record

Mar 2, 2011

I do not know why drCertification.RecordsAffected return as -1. I tested session has value and I ran the sp , it has record. Thanks.

<asp:datagrid id="dgCertification" runat="server" Width="860px" GridLines="Horizontal" CellPadding="2" AlternatingItemStyle-BackColor="Linen" HeaderStyle-BackColor="LightGrey" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="false" AllowSorting="True" AutoGenerateColumns="False"
DataKeyField="ID" BorderWidth="1px" BorderColor="LightGray" BorderStyle="Ridge" ShowFooter="True">
<EditItemStyle BackColor=teal></EditItemStyle>
<AlternatingItemStyle BackColor="Linen"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" Wrap="False" BackColor="teal"></HeaderStyle>
<FooterStyle BackColor="LightGray"></FooterStyle>
<Columns>
<asp:TemplateColumn HeaderText="Certification" HeaderStyle-ForeColor="#0000ff">
<ItemTemplate>
<asp:Label id=lblCertification runat="server" Text='<%# Container.DataItem("Certification") %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="txtCertification" MaxLength=50 runat="server" Width="75px"></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txtCertificationE" MaxLength=50 runat="server" Text='<%# Container.DataItem("Certification")%>' Width="75px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Date Obtained" HeaderStyle-ForeColor="#0000ff">
<ItemTemplate>
<asp:Label id=lblCDateObtained runat="server" Text= '<%# DataBinder.Eval(Container, "DataItem.CDateObtained", "{0:d}") %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="txtCDateObtained" runat="server" Width="75px"></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txtCDateObtainedE" runat="server" Text= '<%# DataBinder.Eval(Container, "DataItem.CDateObtained", "{0:d}") %>' Width="75px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Expiration Date" HeaderStyle-ForeColor="#0000ff">
<ItemTemplate>
<asp:Label id=lblCDateExpiration runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CDateExpiration", "{0:d}") %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="txtCDateExpiration" runat="server" Width="75px"></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txtCDateExpirationE" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CDateExpiration", "{0:d}") %>' Width="75px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton id="lnkbutEdit" runat="server" Text="<img border=0 src=../images/im_edit.gif alt=edit>" CommandName="Edit" CausesValidation="false"></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton id="lnkbutUpdate" ValidationGroup ="CDate" runat="server" Text="<img border=0 src=../images/im_update.gif alt=save/update>" CommandName="Update"></asp:LinkButton>
<asp:LinkButton id="lnkbutCancel" runat="server" Text="<img border=0 src=../images/im_cancel.gif alt=cancel>" CommandName="Cancel" CausesValidation="false"></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:LinkButton id="lnkbutDelete" runat="server" Text="<img border=0 src=../images/im_delete.gif alt=delete>" CommandName="Delete" CausesValidation="false"></asp:LinkButton>
</ItemTemplate>
<FooterStyle HorizontalAlign="Center"></FooterStyle>
<FooterTemplate>
<asp:Button id="btnAddRow" runat="server" Text="ADD" CommandName="AddANewRow" ValidationGroup ="CDate"></asp:Button>
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Public Sub LoadCertification()
'Dim myConn As New SqlConnection
Dim DBComm As New SqlCommand
Dim ds As New DataSet
If myConn.State = ConnectionState.Closed Then
myConn.ConnectionString = ConfigurationManager.ConnectionStrings("NurProfileString").ConnectionString
myConn.Open()
End If
Dim drCertification As SqlDataReader
If myConn.State = ConnectionState.Closed Then
myConn.Open()
End If
Try
DBComm.Connection = myConn
DBComm.CommandType = CommandType.StoredProcedure
DBComm.Parameters.Add("@EmpID", SqlDbType.Int).Value = Session("EmplNO")
'tblNurProfileCertification
'
http://www.shotdev.com/aspnet/aspnet-vbnet-gridview/aspnet-vbnet-gridview-databound/
DBComm.CommandText = "NurCerti_Log_Read" '
drCertification = DBComm.ExecuteReader()
dgCertification.DataSource = drCertification
dgCertification.DataBind()
drCertification.Close()
drCertification = Nothing
DBComm.Dispose()
Catch objError As Exception
Dim myarraylist As New ArrayList
myarraylist.Add("fliao@holyredeemer.com")
MailHelper.SendMailMessage("fliao@holyredeemer.com", myarraylist, "fliao@holyredeemer.com", "", "Annual HR Employee Log Error ", "Nursing Profile Error")
Exit Try
Finally
End Try
End Sub

View 3 Replies


Similar Messages:

Forms Data Controls :: Pop Up To Show When No Record Is Selected And Tell The User To First Select A Record?

Mar 21, 2011

I have a delete button bellow my gridview and I want a pop up to show when no record is selected and tell the user to first select a record. The button click event would show the pop up, but my gridview data blanks out.

Here is my code:

[Code]....

View 1 Replies

Forms Data Controls :: Displaying Details Of Record IDs In A DataGrid?

Feb 18, 2010

I have a series of record IDs in an array that I pass to a DataGrid for Data Binding I want to show the details of each record ID in every row of the datagrid, for example I can put a detailsview in the itemtemplate of the datagrid and use an objectdatasource's select method for retrieving the information for a specific record ID but how to pass these record IDs to objectdatasource? is this a correct example and how can I implement this?

View 3 Replies

Forms Data Controls :: Datagrid Show Unformatted Data From Database Like Test Want To Show Test?

Mar 3, 2011

i have datagrid , data coming from database but data in database as formated , i want to show data wihotu format

below example:

<B> test </B> data base has this type data

but in grid i want to show test not with format,

i am getting same data from database.

View 2 Replies

Forms Data Controls :: Implement A Datagrid With The Possibility To Update A Record

Jul 22, 2010

i am using asp net 2.0 and mysql. I need to implement a datagrid with the possibility to update a record but i am having problems and i don't know why.

this is the code:

[Code]....

the primary key of the table is a composed key fot IdOrdine and IdMezzo.

View 3 Replies

Forms Data Controls :: DataGrid Or Grid-like Control For Record Selection?

Feb 20, 2011

I would like to ask if there is any control act like grid to display records.The 'datasource' will be a customed class, this dataclass has List<T>, so I will populate each element by iteration into the grid.Any control can I use to work like a grid?The number of records will around 100.This control should also allow the user to select a record.

View 2 Replies

Forms Data Controls :: PatientName Show In DataGrid?

Aug 19, 2010

Dropdownlist Show the all PatientName and save the PatientID in the database and in datagrid showing the PatientID my requirement is that the PatientName show in DataGrid.

View 4 Replies

Forms Data Controls :: Show Image Below DataGrid?

Oct 25, 2010

I want to show a image in panel below datagrid if I select particular row.I want to highlite that row in a diff color.

View 3 Replies

Forms Data Controls :: Show A Value From A DataGrid In A Label?

Jan 1, 2011

This should be simple but I am baffled. I have a perfectly functioning DataGrid that I can click its "Select" link to select any one of its rows. When I do, the row highlights itself in red as expected. So far, so good.I also have an independent Label on the same page and I want to update its Text value to a cell value from the DataGrid when I select a specific row.OTH the DataGrid (named GridView1) and the Label (named Label2) are within an UpdatePanel.PROBLEM: When I select a row from the DataGrid, the Label is not updated with the cell's contents. It simply retains its original default Text value.Here is my code:

[Code]....

This code was from the MSDN site, but nothing seems to happen when I select rows within the GridView.

View 5 Replies

Forms Data Controls :: DataGrid Doesn't Show Data After Postback?

Jan 21, 2010

I have a web application that takes information entered by the user and displays it in a few datagrids, that are located withing a multiview.

In order to enter a row to a datagrid the user enters some information and clicking on a button calls a function that adds the data to an arraylist, which is the source of the datagrid. In addition, every postback the data is binded to the datagrid.

It all works fine in the first time, but from the second row and on it enters only parts of the data and ignores the rest.

View 6 Replies

Forms Data Controls :: Gridview Will No Longer Show The Data - Datagrid Datasource = Null

Feb 25, 2011

I am familiar with populating a gridview with data. I am able to bind the Data pulled from the database into the gridview

gridview.DataSource = myDataTable;
gridview.Databound.

If I write the following code, teh gridview will no longer show the data

gridview.DataSource = null;
gridview.Databound.

My question is , I want to make the same thing with a user control that contain a gridview. when I use the user control in an aspx page, I am able to populate it with data, but when I try to make this code, the Datasource does not show, instead, I see .DV. So I tried this code but then , I do not see DataSource property instead I see DV (DataView), when I put .DV = null, I get an error message that the object is not in existed. any idea how to clear the user control gridview from its data.

View 2 Replies

Forms Data Controls :: How To Show A Tooltip With Boundcolumns In Datagrid

Feb 15, 2011

Is it possible, I have the following datagrid, want to show "filename" field info as a tooltip with first column Type in datagrid.

[Code]....

View 1 Replies

Forms Data Controls :: DataGrid - Show The Datatextfield Of Dropdownlist?

Aug 20, 2010

in dropdownlist show the all PatientName and save the PatientID . how to show the PatientName in DataGrid.

PatientID, PatientName are Foreign Keys. In DataBase on Save the the PatientID my requiredment is PatientName show in DataGrid based on PatientID.

View 1 Replies

Forms Data Controls :: DataGrid - How To Show The Datatextfield Value Of Dropdowlist

Aug 19, 2010

how to show the dropdownlist datatextfield selected text in the DataGrid

View 2 Replies

Forms Data Controls :: Datagrid Doesnot Show Right Price?

Feb 11, 2011

[Code]....

[Code]....

View 6 Replies

Forms Data Controls :: Format Datagrid TextBox Getting Data From Database As Test (show As Bold)

Mar 1, 2011

using .NET 2.0 want to format datagrid , i am using DataGrid. i am saving data from textbox to database as formated text. now while retriving data from database i can see html format data i need to format : Example

<B> test my text </B> new test. want to show in dagagrid like test my text new test: and when i click on datagrid i want to see test my text new test this format not styling below code for data grid

<asp:GridView ID = "gvNotes" AllowPaging ="false" PageSize = "5" PagerSettings-Visible = "false" Width = "99%"
CssClass = "Grid" EmptyDataText = "No records found." runat = "server" DataKeyNames = "NOTES_ID"
AutoGenerateColumns = "false" OnRowCommand="gvNotes_RowCommand" OnRowDataBound="gvNotes_RowDataBound">
<EmptyDataRowStyle HorizontalAlign = "Center" Height = "30px" />
<Columns>
<asp:BoundField DataField = "NOTES" HeaderText = "Notes">
<ItemStyle CssClass = "GridRow" HorizontalAlign = "left" Width = "60%" />
<HeaderStyle CssClass = "GridHeader" HorizontalAlign = "left" />
</asp:BoundField>
<asp:BoundField DataField = "DATE" HeaderText = "Note Added Date">
<ItemStyle CssClass = "GridRowPadRight" HorizontalAlign = "Right" Width = "20%" />
<HeaderStyle CssClass = "GridHeader" HorizontalAlign = "Right" />
</asp:BoundField>
<asp:TemplateField HeaderText="Edit">
<ItemStyle HorizontalAlign="Center" Width="5%" CssClass="GridRow" />
<HeaderStyle CssClass="GridHeader" HorizontalAlign="Center" />
<ItemTemplate>
<asp:ImageButton ID="btnEdit" ImageUrl="~/Images/Edit.jpg" ImageAlign="Middle" runat="server"
CommandName="Edt" CommandArgument='<%#((GridViewRow) Container).RowIndex %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemStyle HorizontalAlign="Center" Width="5%" CssClass="GridRow" />
<HeaderStyle CssClass="GridHeader" HorizontalAlign="Center" />
<ItemTemplate>
<asp:ImageButton ID="btnDelete" ImageUrl="~/Images/Delete.jpg" runat="server" CommandName="Del"
CommandArgument='<%#((GridViewRow) Container).RowIndex %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

View 1 Replies

How To Show Record From Data Base To Textbox

Dec 27, 2010

i want show record from database to textbox but i cannot do it shows nothing here is code newuser.aspx.vb

[code]....

correct it i want to show record in textbox but it shows blank provide me the code

View 13 Replies

Forms Data Controls :: Show Datagrid Vertically - Property Not Working

Jan 10, 2010

i am using datadrid and i want to display it in vertically but it is continiously showing in horizontally style. i have made changes in view , property but still not working.

View 2 Replies

Forms Data Controls :: DropDownList In The FooterTemplate Of A DataGrid Will Not Show Its Items?

Oct 13, 2010

I am placing a dropdown list in the footer of a DataGrid like this:

[Code]....

In my code behind file, in the myDDL_OnLoad event handler, I call to the database, populate a SqlDataReader, and set the DDL's datasource to that datareader. I define what data columns should be used for the DataValueField and DataTextField of the dropdownlist. Then I call the DropDownList's DataBind() method. Everything works without error. But, when the dropdownlist is displayed, it has blank lines in it.

By that, I mean if 8 records are loaded into the dropdownlist, it will expand to a size appropriate for 8 rows but, it will be empty. there is no text in it.

Has anyone seen this type of behavior before? This dropdownlist is in the footer of a dynamically loaded ajax update panel so, it is difficult to see the source code to see what values are in the html element rendered to represent the dropdown.

View 1 Replies

Data Controls :: GridView Does Not Show Record Not Next Page

May 7, 2015

In gridview who is fetching the records i allowpaging "true" , but next page of gridview is not showing data. What is wrong with my code?

Here is the code:

<asp:GridView ID="GridView1" AllowPaging="true" runat="server"
onpageindexchanging="GridView1_PageIndexChanging" >
</asp:GridView>
 
C#

public partial class SearchAll : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
BindEmployee();

[Code] ....

View 1 Replies

Forms Data Controls :: Click A Row In A Datagrid And Show A Modal Pop Up To Edit The Item?

Feb 18, 2011

i have a datagrid that i want to be able to select a row and be able to edit the details of the row selected. Im connected to an sql azure db.

View 1 Replies

Forms Data Controls :: Show The Last Record Added When Using FormView?

Aug 30, 2010

I am using FormView to display one record at a time and after I add a new record, it won't display the last recorded added.How can I force FormView to display the last record added?

View 2 Replies

How To Retrieve Record Into Datagrid

Aug 5, 2010

[code]....

i am using asp.net and datagrid i want to show record on datagrid with 3 column but data will be unlimited i want to show record data into datagrid

my table name is user_detail and fields are User_name.Name,Passwordwell i m confussed i m using vb6 which i use recordset in replacement in asp.nety wht i use using access.

View 1 Replies

Forms Data Controls :: Way To Show / Keep Newly Inserted Record In DetailsView

Mar 28, 2010

after a DetailsView (DV) 'Insert' (triggered by a DropDownList (DDL)) the DV shows the first record (in the DDL)!Are there VS2008 means to keep / show the just entered data - again ready with the command row "Edit/Delete/New" enabling me to e.g. "Edit" the just entered data?This DDL/DV scenario works just fine but to show my just entered record I have to leave this page and start calling this .aspx page again in order to see the name in the DDL and, hence, in the DV.I.e. I'm looking for a kind of automatic 'postback' bringing my just entered data back

View 9 Replies

Forms Data Controls :: Show Gridview Footer When There Is No Record In Datatable

Jan 31, 2011

i want to show gridview footer when there is no records.

currently when i delete all record then footer not shown.

i tried

[Code]....

but not working

View 1 Replies







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