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


Top 5 Contributors of the Month
abhays
Clintonzz
cathyhill345
arronlee
mattyclown
Post New Web Links

Retrieving data from database to link to gridview by using listbox

Posted By:      Posted Date: November 29, 2010    Points: 0   Category :ASP.Net
 

hello, I have a search option which a person can use a multi select listbox. I have it coded so it would loop through to see if its selected or not. I also have a stored procedure where the sql statement is coded for the select statement. For some reason, its not populating my gridview. Where am I doing wrong? Below is the code and stored procedure. Thank you, Carlos

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ExportContacts2.aspx.vb" Inherits="ExportContacts2" %>
<%@ Import Namespace="System.Web.Mail"  %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.SqlClient" %>

<%@ Import Namespace="System.Configuration" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    Protected Sub submit_Click(ByVal sender As Object, ByVal e As EventArgs)
        
        Dim strtxtevents1 As String
        Dim lin4 As ListItem
        Dim myArrayList4 As ArrayList = New ArrayList()
        Dim strarr4() As String
        For Each lin4 In eventsi.Items
            If lin4.Selected = True Then
                myArrayList4.Add(lin4.Text)
            Els


View Complete Post


More Related Resource Links

insert the data in database using gridview jquery

  

Hi,

I want to use gridview and bind the data and after i want insert the data in database using jquery,

below the link i got for delete

http://www.dotnetspark.com/kb/1535-delete-row-from-gridview-and-database-using.aspx

but i want the sample example for insert  row from gridivew and add the database.


Regards


Suggestion on retrieving data from a database

  
hi everyone, I have a page which will retrieve data base on drop down lists and place the data onto  a gridview. When the data was entered, each field was entered with multi-selected and delmited by a comma. In the database, some fields will have a string with multi information delmited by the comma, for example, Chicago, Atlanta, NYC will be recorded and place in the field in the database. I'm trying to search now but with a dropdown list with Chicago, Atlanta, and NYC being an individual record. If the person selects NYC, all of the records from NYC will appear even though Chicago and Atlanta are part of the string. Can someone show the right direction to do this? Thank you, Carlos The following is the code for the current page:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ExportContacts1.aspx.vb" EnableEventValidation = "false" Inherits="ExportContacts1" %> <%@ Import Namespace="System.Web.Mail" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub exportcsv_Click(ByVal sender As Object, ByVal e As EventArgs) Dim objStreamWriter As IO.StreamWriter objStreamWriter = New IO.

Q about retrieving data from database

  
Hi, I'm having a question about retrieving data. I'm using VS 2008 and I have to create a new consultation record for a patient and I've already created a database with 3 tables, which are doctor, patient and consultation. I have 10 records saved in consultation table, and I've made a aspx form which contains a DetailsView that ask for new consultation details to be added. But I have to be able to get the doctor and patient information from the database and put in the DetailsView, then fill in the rest of the consultation details. The information entered have to be written to the database in the consultation table. But I don't know how to get doctor and patient information from database and apply them into the DetailsView so that doctor who wants to add new consultation details can select patient and doctor information from the database.I was thinking maybe I need to do a query with insert statement and apply into the DetailViewthis is the query i have:INSERT INTO [Consultation] ([ConsultationID], [GPname], [PatientFirstName], [PatientLastName], [Height], [Weight], [IllnessDescription], [Diagnosis], [Date]) VALUES (@ConsultationID, @GPname, @PatientFirstName, @PatientLastName, @Height, @Weight, @IllnessDescription, @Diagnosis, @Date)as you can see, I need to get the GPname, PatientFirstName and PatientLastName from the database tables and the rest will be fi

make Gridview data as hyper link with alias open in new window

  

Hi..

I have one asp.net C# page in which i have gridview..

This are the url comes from database and binded in gridview

www.xxxxxx.com/A/Default.aspx

www.xxxxxx.com/B/Default.aspx

www.zzzzz.com/C/Default.aspx

what i need is i need to show this url has like this

www.xxxxxx.com/A/Default.aspx is like Test1

www.xxxxxx.com/B/Default.aspx is like Test2

www.zzzzz.com/C/Default.aspx is like Test3

if user click Test1 it will open a new browser window with www.xxxxxx.com/A/Default.aspx

if user click Test3 it will open a new browser window with www.zzzzz.com/C/Default.aspx 


how to make this in gridview please help me in this...





Retrieving Data From Database

  

I got two tables called Genre and Albums.


I want to access data (all the albums) inside each Genre how can i do it.

Do i have to make viewModel for this  or some thing else and what sort of query can i use.


Thanks in advance


Web.Config issues - Trying to add SQLExpress database link so that I can see a GridView in a Web Pag

  

Current Web.Config
<?xml version="1.0"?>
<configuration>
  
    <configSections>
      <sectionGroup name="system.web.extension

Searching TextBox data in sql database and binding the result in gridview

  

Hi,

I have few textboxes and I want to search the text (partial search is also required) in the database and then show the result in a telerik grid. The grid has to be hidden initially and when I click the search button it should show up and display the results. Can anyone provide me the code to do this.

Thank YOu,

getsetgo19


Listbox values to display data from database

  

Hello,

I have a listbox which comprises of data " systemname" . I have a sql database table with columns ( systemname, ip, downmins,pdowntime,udowntime and reason).

On the basis of the selection from the listbox i want to display the respective records for the systemname with all columns mentioned above.

Now I need to be able to take user entry for the columns (pdowntime,udowntime and reason) from the user either through table or gridview and populate this data in the database.

Note - the listbox is getting populated from the table directly using an sql query at the backend.

 

 

 

 

 


how to use progressBar for retrieving data from the database.

  

Can someone tell me how to create a progressBar to show the data retrieving progress. 

 

Thanks


Retrieving changed/updated data from all tables in database

  

Hello,

I'm looking for some advise on how I could solve the problem I face, I have various instances of sqlexpress 2005 in different remote locations which are not accessible via internet vpn etc as they are all in corporate networks that will not allow access. What I think I need to do is create some sort of process/service that can be installed on the client and run at a set time/date that collects all the data from theses instances and then push the changes to our remote instance of sql server. Can anyone possibly point me in the right direction of various technologies I should be looking into to solve this problem. All clients would be running windows XP. I have been searching for a few day's but I can't find anything to get me going. If this is not the right forum for this type of question can you suggest any?

 

Thank you.


Editing the Data in a GridView

  
In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

Adding Rows in GridView without using a Database

  
This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

  
This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

ListBox tricky to set in a DataGrid/GridView

  
Listboxes are very tricky to set selected items in grid - there is no real nice way to do it. It would have been great if Microsoft included a property that accepts an array or comma separated values - or anything! But they only allow each item in the list to be selected individually. The way to do this in a grid is a bit messy, but it is fairly simple to implement. When a row is created (as per the event), select the items of the listbox as per the datagrid source data:
Categories: 
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