ORM Vs Parametrized Queries If Only Concern Is Speed Of Data Access?
Jan 11, 2010
I work in an ASP.net/ SQL Server development environment. If my only concern is speed should I go with parametrized queries or should I use an ORM such as nHibernate or LINQ?
View 5 Replies
Similar Messages:
Feb 26, 2010
I could use some guidance on a better way get get my data than I am using. This way is taking nearly 45 seconds to get the data and bind it to a gridview here are my methods used to get the data
[Code]....
then my data access class is:
[Code]....
View 1 Replies
Aug 13, 2010
so I have a web programming assignment for university where I'm building a website that uses an Access database but I have hit a brick wall with something.I'm using parameterized queries to query my database. For one of my queries, I want to be able to take a bunch of parameters that are optional, and if they aren't needed I'll pass in a value of null and I'd like the part of the where clause relevant to them to evaluate to true. This is straightforward in most databases, from my understanding you could do something like to make param1 an optional parameter.
WHERE ((@param1 = ARandomColumnName) OR (@param1 = null))
However this can't be done using Access, as all parameters in a query are represented by a ?. Every ? is assumed to refer to a different parameter, so if you want to use a parameter more than one (like the above code I wrote does) then you'd have to pass it twice. This seems hacky to meSo what do I do? I have spent *hours* googling and banging my head on the desk. I'll cry if I missed something really obvious
View 2 Replies
Feb 26, 2010
VWD 2008 Express. Visual Basic.
I know how to create an AccessDataSource on my aspx page and how to use the datasource to populate gridviews, etc. But I want to know how I can programmatically populate a dataset by querying an Access database. How do I make queries to an Access database programmatically?
View 8 Replies
Mar 20, 2010
All the users of my system get a common Id (SystemUserId). There are predefined roles/groups in the system. One user can be belong one or more of these groups. We are populating the menu/dashboard at runtime according to logging credentials.All common details (properties) of group are stored in main table (SystemUser) and specialized details are stored in relavant tables.(Teacher/Student). My solution already has classes called, SystemUser, Teacher & Student.
Problem:My system should support new group addition. (eg-: Auditor)This should support new properties to be added to SystemUser/Teacher/Student or any other new group added by the Customer at runtime.
View 4 Replies
Feb 25, 2010
Is there a way to combine the LINQ queries together and have access to both of the results independently?
[Code]....
View 10 Replies
May 31, 2010
I've implemented URL routing in my new ASP.NET 4 Web Forms application and it's actually working quite nicely. It's an ecommerce app so product names are in the URL now -- as opposed to ProductIDs.The other day, as I was testing the application, I came across a situation where two product names had identical names. It then dawned on me that in order to prevent this from happening, one of the things I'll have to implement is adding product categories in front of the product name -- which is not a bad idea to begin with. However, now I'll end up with a really long varchar field in the database that needs to be indexed. Additionally, I'll have to make sure that this field will stay unique i.e. I can't allow /electronics/digital-media-players/accessories/some-generic-recharger in that field more than once otherwise, my URL routing logic won't be able to determine which product the user is requesting.I'm sure others have run into such issues. I'd appreciate some advice on this.
Is adding product category in front of the product name in an effort to make it as unique as possible a good idea? After all it's a lot less likely that some-generic-recharger will be there more than once under a specific product category than in any category.Will indexing a field with such long varchar values be a problem in terms of database and lookup performance?Is there another approach that would work better in my situation?
View 1 Replies
Apr 9, 2010
I have a the following code to get data from an oracle database using
a parameterized query:
conn = New OracleConnection(connectionstring)
comm = New OracleCommand("select name from Cust_name
from Name_Table Where last_name = :lastname", conn)
parmLastName = New OracleParameter("lastname", OracleDbType.Varchar2)
parmLastName.Value = "Jones"
comm.Parameters.Add(parmLastName)
I am trying to write an audit that will tell me what users are doing, so I would like to get the actual sql that is submitted. This is just one example of the query, there are many more so I would like to make it as general as possible. I would like to actually see "
select name from Cust_name from Name_Table
Where last_name = "Jones". I know I could just create the text
View 2 Replies
Feb 8, 2011
I am creating report in winfrom. I am having three radio button and one button , when user click on any of those radio button and click on the button the report has to sort according to that. I am not asking about interactive sorting.
View 4 Replies
Sep 14, 2010
I'm using parameterized sql query to get data from database
string query = "Select * from employee where employee_city in (@value)";
strign city ="'NewDelhi','Bangalore','Mumbai'";
I'm using following code to achive this
[code]...
But this is not giving the result. If run the query in SQLServer query window as "Select * from employee where employee_city in ('NewDelhi','Bangalore','Mumbai')", records are there.
But the same query will not return any records from ADO.Net.
View 4 Replies
Nov 19, 2010
I have a number of automatically generated data access classes to handle things like inserts & updates. These look like:
cmd.CommandType = CommandType.Text
cmd.CommandText = "UPDATE myTable set f1 = :f1, f2 = :f2, f3 = :f3 where id = :id"
cmd.Parameters.AddWithValue(":f1", _f1)
cmd.Parameters.AddWithValue(":f2", _f2)
cmd.Parameters.AddWithValue(":f3", _f3)
cmd.ExecuteNonQuery()
If I were to re-write the sql to do what I want, it would look something like
cmd.CommandText = "UPDATE myTable set f1 = pkg.getMyValue, f2 = :f2, f3 = :f3 where id = :id"
Is there any way to do this by setting _f1 to a "special" value, without changing the update SQL or the way the parameters are set? Only in certain cases will I need to set the value of f1 - most of the time, it will be null.
Using .net 2.0, and system.data.oracleclient against oracle 11.
View 1 Replies
Jun 10, 2010
I have a gridview which I connect by C# and SqldataSource. I use asp.net 2.0 - 3.5.
I want to parameterized the queries and how do I do this in the C# file ? how do I set the selectparameters in C# ?. I do not want to do this in the aspx fil.
My code in C# is:
SqlDataSourceMachineName.SelectParameters.Clear();
SqlDataSourceMachineName.SelectCommand = "Select MachineName from tblMachine inner join tblLocation on tblMachine.MachineLocationID = tblLocation.LocationID where tblLocation.LocationName = 'New York' and
tblMachine.StatusID = '1'";
View 9 Replies
Aug 13, 2010
SELECT ClientMaster.ClientName,*
FROM ProjectMaster LEFT JOIN ClientMaster
ON
ProjectMaster.ClientCode=ClientMaster.ClientCode
WHERE
ProjectMaster.RefCode IN (@refcode) AND ProjectMaster.ProjectStatus=@status
@refcode should be able to contain multiple values but how should I pass value to the parameterized query?
I have tried many ways such as @refcode = 'VALUE1','VALUE2', @refcode = VALUE1,VALUE2 but to no avail?
View 3 Replies
May 31, 2010
I would like to get validation messages for validation controls from resource files. I know I can do that easily by following code snippet.
<%$ Resources:[filename prefix,]resource-key %>
or
<asp:Label ID="Label1" runat="server" meta:resourcekey="resource-key-prefix" />
But I would also like to parameterized it.
e.g.
Above Resource Expression will give me message like "Fill Information.". What I have in resource file is "Fill {0} Information." which should show end user message like "Fill Address Information.".
View 1 Replies
Aug 30, 2010
I'm using Webservice which will return the data from the database through datatable and I'll convert the datatable into byte array. In front end, I'll reconvert the bytearray to datatable and used ajaxloader to display it in the form.. It is dynamic loading. So, for each click, it is taking 10 seconds to retreive the data regardless of the size of the data. So, I used static datatable and I've loaded all data in that datatable in page load event. But, no reaction. It is taking only same time. Even, there is no data to retreive, the ajax loader is going on loading for 10 seconds. Problem is with Ajax or my webservice??
My Code for listboxclick event
protected void listboxcity_SelectedIndexChanged(object sender, EventArgs e)
{
string sqlvalue = string.Empty;
//Thread.Sleep(200);
for (int i = 0; i < listboxcity.Items.Count; i++)
[Code]....
View 1 Replies
Jan 14, 2010
Sometimes my gridview can take a second or two to get into in edit mode, and other time it can be 5-10 seconds. Is there something I can do to make the transitions from each state more uniform?
View 3 Replies
May 8, 2010
I have a WCF method that returns a huge number of rows, causing a long wait for end user.
Also I do not have IIS7 but only IIS 6 for my WCF.
Is there any way I can speed up the WCF response so user does not wait for a longer time?
View 4 Replies
Oct 20, 2010
I have a gridview that displays query results on a reporting page for a "home-grown" CRM application. From the gridview, a link can be clicked which opens a modal window that contains an iframe linked to a "details" page where record specific info can be viewed/altered. On the details page there are 10 or so dropdownlists (ddls) that are bound every time the page is called. The ddls are bound using a method similar to the example below. I am looking for a way top speed things up a bit. The details page could be called 10-20 times in one session and every time the page loads these ddls have to be bound from the same methods but for different records. What are some options for speeding up the load time for this page??
[Code]....
[Code]....
View 6 Replies
Aug 2, 2010
I am facing problem with images loading time. In my form I have image server control placed in repeater control. The repeater control every time binds atleast 300 images. When we want to see all the images at a time the page is taking lot of time(atleast 3 to 4 mins) to display. But I need the page should be loaded fast.
The image url is from physical location.And the information related to image is coming from database.
I am using .net framework 3.5 and C#.net as language in asp.net web application.
View 3 Replies
Oct 26, 2010
I'm trying to pull data from two queries and want to display each row seperately in the view. Here's what I have so far, but it's not working.
I added this model
[Code]....
And added this method in the controller
[Code]....
View 1 Replies
Jul 22, 2010
Is it possible to bind data to specfic columns in Gridview?
I mean, if I send a query to my database and it returns 1 column, then bind that column to the first column in the gridview, then send another query and bind the resulting column from that query to the second column without erasing the data of the first column etc etc.
View 11 Replies
Jan 11, 2010
I have Sql Table for Products that have ~8000 records. In my web form I want use dropdown list to edit code with dropdown list. This drop down list populate very slow. How to increase speed to populate dropdown list with large amount data.
View 1 Replies
Feb 15, 2011
've made a quiz/score system where a user will go through categories (page by page using querystring) and after submitting his/her score i redirect them to the next page where i show them their score and i also want to show "out of x number of questions".
I've made a query in my dataset:
[Code]....
I get an error about "Cannot implicitly convert type "void" to "object". This is the first time i am trying to use the SQL COUNT so i am almost certain it has something with the way i write it in my BLL, but i cannot figure out why or how to write it as it should. Hopefully you can direct me in the right path?
View 5 Replies
Nov 17, 2010
I am a total newbie here. I have generated a web page using Visual Studio 2008. It connects to a database and lets me insert records. On the bottom of the form it automatically pus a link for "Insert" or "Cancel". I need them to be buttons. Is this possible? I don't even know where to begin.
View 4 Replies
Jan 23, 2011
eg: thiss is the ordinary query
[Code]....
how in linq??
View 1 Replies