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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Retrieving data

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net
 

Hello,
I want to know ,we have sql data source to retrieving data from database for example retrieve data to Grid view and we can write code by many way as use data adapter
I use first one and second one ,but I want to know which is the faster for website
means website be faster which way data source or code.

Hello,

I want to know ,we have sql data source to retrieving data from database for example retrieve data to Grid view and we can write code by many way as use data adapter


I use first one and second one ,but I want to know which is the faster for website

means website be faster which way data source or code.


View Complete Post


More Related Resource Links

"An error occurred while retrieving data from Oracle Instance..."

  

I have succeffuly Imported the ADF and have also successfully created a Business Data Column. But when I try to query data , I get the following error

An error occurred while retrieving data from Oracle Instance. Administrator, see the server log for more information

And this is what I found in the Application Logs
A Metadata Exception was constructed in App Domain '/LM/W3SVC/81256521/ROOT-1-129217212004078822'. The full exception text is: LobSystem could not be found using criteria 'id=476'.


Problem while retrieving data from a lookup column from sharepoint linq.

  
Hi I am working with sharepoint linq concept. When I am giving a query with lookup column It's working fine.  But when i am trying to retrieve the data from a look up column to spgridview. I was unable to get the output. Here is the above code which i have worked.   string strTitle = string.Empty; string strStatus=string.Empty; var context = new LinqSampleDataContext(SPContext.Current.Web.Url); EntityList<SharePoint2010ConceptsItem> Concept = context.GetList<SharePoint2010ConceptsItem>("SharePoint 2010 Concepts"); var query = from cs in Concept where cs.Status.Title.ToString()!="Completed" select new { cs.Title, cs.Id, //cs.Status }; sgvConcepts.DataSource =query; sgvConcepts.DataBind();   Any help me plz how to retrieve the data from a lockup column.bvnprasad

Problem with Retrieving data from lookup column using SharePoint 2010 Linq Concept

  
Hi I am working with sharepoint linq concept. When I am giving a query with lookup column It's working fine.  But when i am trying to retrieve the data from a look up column to spgridview. I was unable to get the output. Here is the above code which i have worked.   string strTitle = string.Empty; string strStatus=string.Empty; var context = new LinqSampleDataContext(SPContext.Current.Web.Url); EntityList<SharePoint2010ConceptsItem> Concept = context.GetList<SharePoint2010ConceptsItem>("SharePoint 2010 Concepts"); var query = from cs in Concept where cs.Status.Title.ToString()!="Completed" select new { cs.Title, cs.Id, //cs.Status }; sgvConcepts.DataSource =query; sgvConcepts.DataBind();   Any help me plz how to retrieve the data from a lockup column.bvnprasad

Getting error while retrieving data from sql server 2008 to infopath 2007 in sharepoint 2007

  
Hi, I have created an InfoPath form in InfoPath 2007. In this form I am getting data from SQL Server. To do this I have created data source for SQL Server 2008’s Tables. I have created 4 connections for 4 tables. When I am previewing this form from InfoPath Designer 2007, it is working. But when I am publishing this, it is giving me an error ‘Can not update content type’. If I skip this error then my form published but when I open this form from Share Point 2007. It gives me an error:   There has been an error while processing the form. Click Continue to resume filling out the form. You may want to check your form data for errors. Click Start Over to load a new copy of the form.   An error occurred accessing a data source. An entry has been added to the Windows event log of the server. Log ID: 6932 G. Goyal

Storing and retrieving historic data

  
Hi, I am looking at making my database historic and would like some pointers. Data older than 1 year does not need to be kept so every 12 months, data is "recycled". So far I have come up with the following using DATEPART and all data is in the same table (tables simplified): 1. When I insert records: INSERT INTO [Table] VALUES (newid(), @FKID, @Value, GETDATE()) 1. When I update records: UPDATE [Table] SET [Column] = @Value WHERE [FK] = @FKID AND (DATEPART(month, GETDATE()) = DATEPART(month, [TimeStamp])) 2. When I select records: SELECT * FROM [Table] WHERE [FK] = @FKID AND (DATEPART(month, GETDATE()) = DATEPART(month, [TimeStamp])) 3. WHEN I delete records: DELETE FROM [Table] WHERE [FK] = @FKID AND (DATEPART(month, GETDATE()) = DATEPART(month, [TimeStamp]))   Is this efficient? I was looking at partitioning, but I am not sure that it would be feasible as I want to recycle data every 12 months. Or is there a better way to do it? Regards, James

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

Issue in the Format of the Data while retrieving from Cube

  

Hi,

I have an MDX which returns me certain columns like "Sales Value", "Sales Units" etc. Now I need to find the average price which will be Sales Value/ Sales Units. But when I write this in MDX then sometimes I either get empty space or any gibberish value. I want to know what format type I need to select to fetch the actual value. My value would come something like, 0.00231.

The MDX that I have written is,

with

Member

 

[Measures].[Current Year Sales Value] as ' ( [Measures].[SalesValue], [PERIOD].[All PERIOD].[MAT1]) '

Member

 

[Measures].[Previous Year Sales Value]

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


retrieving data records from xml data file using xaml(WPF).

  

I have an XML data file, and I have designed a XAML file with data binding to the data fields found in the XML data file.

When I run the XAML application, the first XML data record is displayed in the correct fields on the panel.

Is it possible to design an application to retrieve multiple records (multiple instances of each data field) using XAML alone?  or are C# (or VB) "code-behind" event handlers necessary to retrieve(or add) beyond the first record?


Retrieving encrypted data in code

  

I am using sql server 2k5 database encryption with a symmetric key protected by password. Symmteric key password is stored in application memory on the server and cannot be stored in plain text in sps.

In SQL Mgmt Studio, i run a query opening symmetric key, exec Mysp and close key - data returns decrypted. In my c# code tho, when i want to call the same sp to read some encrypted data, i am issuing 3 separate commands since i am using stored procs to return data. In order:

  1. submit the SqlCommand(CommandType=Text) “open symmetric key MyKey decryption by password = ‘mypassword’” to open the key
  2. submit a SqlCommand(CommandType=SP) to call my stored proc with parms etc. to read encrypted data
  3. submit the SqlCommand(CommandType=Text) “close symmetric key MyKey” to close the key

If i issue the 3 commands in that order, the data is returned but encrypted columns are not decrypted.

The only way i can get back decrypted data is to wrap all 3 commands in a sqlTransaction. Since some stored procs are taking a long time to return it is causing deadlocks (long running sps is another issue). i am simply reading data so dont need transactional context but it seems unless i open the key, read my data and close the key in a transaction the key does not remain open

Q. I

Are distributed queries a better way of retrieving data for analysis when compared to an ETL?

  

Hi,

We need to analyse some data in a database which is hosted on remote server. So we planned to copy that data into a new database using ETL and analyze it but we are not allowed to copy that data without permissions. so now we are thinking about using distributed queries like linked server, analyze the data on remote server and copy that analyzed data in our DB using distribute queries as we can copy that analyzed data.

 

 Any one has any idea of issues that occur if we use linked servers in the products that are shipped beacause to my idea there is o product with linked server concept in it as it will have some issues with permissions and all it seems. So can any on f you help me out with this please

Thank You so much...

 


Retrieving JavaScript data from a post

  

Hi

I'm using the WYSIWYG editor TinyEditor (http://www.leigeber.com/2010/02/javascript-wysiwyg-editor/), and I'm having an issue recalling the updated data. I searched the forum and found someone else had the same issue:

http://forums.asp.net/p/1526709/3684896.aspx#3684896?Accessing+textarea+value+in+code+behind

Thing is, I think I've done everything in the post, but my code is just not working. When I click submit, the variable in the code behind (val) isn't capturing any data - Object reference not set to an instance of an object.

Here's my code:

<%@ Page Title="" ValidateRequest="false" Language="C#" MasterPageFile="~/BackOffice.master" AutoEventWireup="true" CodeFile="about-us-club-officials.aspx.cs" Inherits="secure_page_content_about_us_club_officials" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" Con

Retrieving data from database to link to gridview by using listbox

  

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

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.


Retrieving Data as Objects

  

I have two classes as User and Country. User class is having a property which is object of Country. User database table is having a CountryID column.

While Retrieving User Data as Objects it gives below error:

Invalid cast from 'System.Int32' to 'country'

which is true because data table is having int and class is expecting Object of country.

Below is the menthod which I am using:

public static IEnumerable<User> GetAllUsers()       

{           

IEnumerable<User> userData = null;           

try           

{               

IRowMapper<User> mapper = MapBuilder<User>.BuildAllProperties();               

 

Database Db = DatabaseFactory.CreateDatabase();               

// Create a stored procedure accessor that uses this output mapper               

var accessor = Db.CreateSprocAccessor("GetAllUsers", mapper);               

// Execute the accessor to obtain the result

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