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

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

Result of SQL Select in Gridview

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hi All,I want to have a gridview which first column is a link to another page. For that I want to create a link text through a SQL query!I have the following piece of SQL code, to create the first column of the gridview:SELECT '<a href="Page.aspx?pr=' + CAST(tb_table.NameId AS varchar) + '">Selecionar</a>' AS Expr1,I want that code to give me something like: SelecionarInstead of that I get directly in the gridview:    <a href="Page.aspx?pr=1">Selecionar</a> If I go to the source code I see the following:<td>&lt;a href="Page.aspx?pr=1"&gt;Selecionar&lt;/a&gt;</td>What I get in the gridview, is what I want to see in the souce code, so I have the link in the gridview.Does anyone knows the solution? Thanks in advance.

View Complete Post

More Related Resource Links

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

Select value in gridview


Hi, I am new to gridview. I want to make a gridview. Its row when selected should direct me to a specific .aspx page.Each row should direct to a different page. Should I use querystrings for this? Please suggest. Regards, ap.

Select all checkboxes in gridview using Javascript


Hello members,


              I have used "Check box" inside the gridview...

              I need,

                           If i select the header check box , It should select all the checkbox inside the gridview...

              I have searched in google for this coding ...I got  lot of codes but couldn't get the correct code...

              I request anyone please provide me the correct code(using Javascript) thanks...

Gridview how do you select a row and colunm


I have a buttonfield button on my gridview, when I click of the buttons on one of the rows, from colunm[0] row[0] I need to display that contents in a textbox on another div and panel. How do I do that? 

On New Item form, select item on choice dropdown based on query result.


I posted this on Experts Exchange awhile back with no answer, so here's hoping someone here has an idea :)

So I've mostly figured this problem out, but I need some help in getting over the hump... note that I'm using JavaScript to do this (SPServices) on SharePoint 07'.

I'm on the New Items page of a list. Based on a user's selection in a "Teacher" dropdown, I'm doing the following:

1.) Get the value of the Teacher field and several other fields (School and Visit Date)
2.) Run a CAML query based on those fields to find the last list item entered for that Teacher

So here's where I'm stuck...

I have 10 choice fields, all with choices 0, 4, 7, and 10. Depending on what they were set to in the last entered item (which I queried), I want to set the selected item on each of those dropdowns to equal that. So "Score 1" was set to "4" on the la

Repeater and Gridview with select button

Hello every oneI have the following issue:I have a repeater that iterates over a datasource, and each detail of the datasource has a type of control or entry method, I have an enum to represent the type of controlenum ENTRY_METHOD : byte { SINGLE_SELECT = 1, MULTIPLE_SELECT = 2, OPEN_TEXT = 3, FLEXI_SELECT = 4 }And I have this in the repeater's ItemCreated event: switch (EntryMethod) { case ENTRY_METHOD.SINGLE_SELECT: break; case ENTRY_METHOD.MULTIPLE_SELECT: break; case ENTRY_METHOD.OPEN_TEXT: break; case ENTRY_METHOD.FLEXI_SELECT: break; default: break; }This is the aspx file:<asp:Repeater ID="RptUserDefinedInfo" runat="server" OnItemCreated="RptUserDefinedInfo_ItemCreated"> <ItemTemplate> <div style="width: 30%; display: inline-block; vertical-align: top; margin: 10px;"> <asp:HiddenField ID="HddUDTypeID" runat="server" Value='<%#Eval("UDTypeID") %>' /> <asp:HiddenField ID="HddEntryMethod" runat="server&q

How to mingle the result of two select queries?

Hi All,   I have one table like this: 1-id 2-title 3-source   info is like: 1, "news title 1" , "reuters" 2, "news title 2" , "afp"   there are approx. 10,000 records from which the first 5000 come from "reuters" and the rest come from "afp". I want to create a news listing page, so I have to mingle both news types. Union and Union All does not work because it keeps the reuters-related records on top of AFP related while I need a list of 20 news containing both Reuters and AFP. what is the best solution (including performance concerns) to do this?   thanks  

Use Data in a Column as Select Button in GridView

I don't want to use the built in "Select" hyperlink that's in the gridview, I'd like to just use the first data column, is there a way to do that or are we forced to use the automatically generated "Select" column.Thanks!

Binding Web Service Result in asp:gridview and enable sorting(paiging)

Hello everyoneI have web service and gridviewI'm binding it without problemcode: protected void Page_Load(object sender, EventArgs e) { GetCallsService wservice = new GetCallsService(); List<Call> list = wservice.getCalls(2); GridView1.DataSource = list; //GridView1.AllowSorting = true; GridView1.DataBind(); } But I want to enable sorting and(or) paging.   GridView1.AllowSorting = true; this doen't solves problem.everything worls fine if I'm usign sqlDatasource but when datasource is web service it doesn't wokdoes enyone know solution?

GridView Select Open New Internet Explorer Window

Hi, I'm wondering if there is a built in way to take a GridView select buttons and have them open an IE window or tab and link a FormView Control to that link.Basically a Master-Details type of view, but in a new window instead of the same window.

XMLDatasource with gridview: only first result is showing

My gridview is showing only the first result from the data I have assigned to the XMLDatasource.This is this XML:<response>-<lst name="responseHeader">    <int name="status">0</int>    <int name="QTime">0</int>    <lst name="params">        <str name="facet">true</str>        <str name="fl">        id,title,city,score,location_rating,introtext,location_rating_total,themes,features,official,services        </str>        <str name="indent">on</str>        <str name="start">0</str>        <str name="q">*:*</str>        <arr name="facet.field">            <str>province_raw</str>            <str>services_raw</str>            <str>themes_raw</str>            <str>features_raw</st

Select necessary data from Gridview row

Is it possible to select a row without using the SELECT hyperlink/button besides I don't want to slect the entire row instead, i can select the row of the checked radio button? Based on this example image, I just want to retrieve the data from column FROM, TO, FLIGHT and the selected radio button which is PHP 2899.00.

Textbox -> Value -> Gridview -> Select Statement

Hi guys. I have textbox that searches for first or last name. Result show in gridview. But when add value in text box and push my button Find nothing happen. Here code:aspx:........ <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="MobileNum" DataSourceID="SqlDataSource5" style="font-family: Verdana" onselectedindexchanged="GridView1_SelectedIndexChanged"> <Columns> <asp:BoundField DataField="FNAME" HeaderText="FNAME" SortExpression="FNAME" /> <asp:BoundField DataField="LNAME" HeaderText="LNAME" SortExpression="LNAME" /> <asp:BoundField DataField="MobileNum" HeaderText="MobileNum" ReadOnly="True" SortExpression="MobileNum" /> <asp:BoundField DataField="HomeNum" HeaderText="HomeNum" SortExpression="HomeNum" /> <asp:BoundField DataField="OfficeNum" HeaderText="OfficeNum" SortExpression="OfficeNum" /> <asp:Bo

Retrieve data from select columns without creating Gridview etc??

I have an accessdatasource with multiple columns, one column I use it to populate a dropdownlist. Can I use the data from other columns to insert into a table,  insert being done in the aspx.vb page, without creating gridview etc.   Is it possible to make a detailsview one column visible= false and still be able to evaluate its contents? Thanks,

Dropdown select message in item template gridview dropdwon list ???

Hi ....I have used gridview item template , which has two dropdown list .The first dropdown list is binded from database to the dropdown list I have using the below code , to show the select message in dropdown list before selecting any item from dropdown list.In first row its show me --Select-- message and my vaues.. if i select some value form dropdownlist and click add new button it will create a new row dynamic then in previous row again it come back --Select-- message... on going to second row....I need to remain first row user selected value on going to next row.The New row will show --select-- message..Please go to my code and let me know what to do<asp:DropDownList id="DropDonList2" tabIndex=11 runat="server"          OnSelectedIndexChanged="DropDonList2_SelectedIndexChanged" AutoPostBack="True"          DataTextField="SizeRange" DataValueField="SizeRange"          OnDataBound="DropDonList2_DataBound" __designer:wfdid="w10"          AppendDataBoundItems="True">  <asp:ListItem Value="-1">Select</asp:ListItem> </asp:DropDownList><asp:DropDownList id="DropDonList2" tabIndex=11 runat="server" 

How to use GridView.SelectedPersistedDataKey to select a row


I thought this was easy but found the properties of GridView.SelectedPersistedDataKey are essentially read-only. I tried to create a new Datakey to no avail. Could anyone to pass a pointer to an example of how to set GridView.SelectedPersistedDataKey?

Select only one item through radi button in gridview


Hi friends i have a gridview with radio button.i need to select only one item through out gridview i have written code that is working fine but that is giving problem in paging i am displaying gridview with 5 records per page.in first page i am able to select only one item but if i move to second page here also i am able to select only one radio button in this mean time if move to first page in that page also radio button is in selected mode .How can i make only one radio button selected in through out gridview and How can i get paging data from gridview(if i select 3rd page value and i moved to first page in that situation i need to get get that 3rd page value aslo ).How can i get that data pls help me

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