|
Since each creation of a new table adapter will require one or more network round trips to populate the date, it is better to persist a reference as long as the data contained is not likely to become stale rapidly. The trade off is that keeping populated table adapters around can consume a lot of memory if the tables are large.
|
|
|
|
|
You seem to be inferring that each instance of a table adapter stores the data from the table in the application. Are you certain this is correct as I assumed that data was only retrieved once the Select function of a table adapter was called in order to fill a data table object? (It is possible that my orginal message was not clear enough and you thought I was referring to data table objects rather than table adapters)
I always assumed that table adapters stored connection details for the appropriate database object - these are the resources I was hoping to find out about so that I can ensure my application is not leaving connections open inappropriately or unnecessarily hammering the database.
|
|
|
|
|
I'm not going to comment on Table Adapters as I don't use (like) them very much. However, you may want to look at using Query Analyzer to see what is happening with your connections (and queries). This tool is invaluable.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
NamelessParanoia wrote: ou thought I was referring to data table objects
Yes, I was confused...
Each call to Myadapter.Fill or Myadapter.Update will cause a network round trip. If you open the connection before calling Fill, then the connection will remain open, otherwise it is opened and closed for you. The data (and schema information) gets stored in the datatable/dataset.
|
|
|
|
|
Hi Guy's
i am searching for the details about 'Fine Tuning of SQL-Query' can any one give me any good site or other details about this. I mean what steps are carried out to increase the performance of SQL Query? so the data will flow fluently please help me...
Thanks in advance
Sasmi
|
|
|
|
|
In SQL Server, you can use the Query Profiler. Also, you will want to look at the execution plan for your query.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi.can someone help me in writing code for retrieving records from database table.i should get the list of records when the page of my web aplication is loaded.
thanks in advance
|
|
|
|
|
Too vague. Have you attempted to search for a tutorial on ADO.NET?
|
|
|
|
|
How to Integrate SQL server 2005 Reporting Services into asp.net Application
|
|
|
|
|
hi,
what is the differance between connected and unconnected layer?
I read a book that tried to explain that but
I saw in the examples that in both layers
the commands are the same and you can retrieve data insert data
and so on.
so what is the differance?
|
|
|
|
|
A connected system will keep the connection to the database open. Disconnected means that the data is read in to memory, and the connection is closed - if the data changes, a connection to the database is obtained to persist the change and the connection is closed again.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have written a data access layer running under com+
Using the IBM Informix ODBC driver, I am able to select from a table with no problems, when I attempt to updtate the table, the error I receive is "Invalid string or buffer length" (all my googling seems to indicate that this message may have something to do with parameters)
I have set up a test application that performs identical operations to the com+ app. These are:
. Open Connection
. Create a select command
. Fill dataset adapter using select command and adapter
. Alter 1 single field in a single row
. Create an update command
. Call adapter.update
Now here's the weird thing.
The test app works fine, the com+ app fails. When I compare the SQLTrace between the 2 applications. The test application which works, generates many, many more ODBC instructions than the failing com+ app.
Each application is performing the identical workload through the same driver using the same the system.data.odbc objects.
Does anybody have any ideas? I've been banging my head against this for a while now and have no idea what to try next.
Much thanks.
-- modified at 3:35 Wednesday 10th January, 2007
|
|
|
|
|
The bug was caused by me having only one pair of eyes.
Adding another 2 eyes to the code revealed...
That If you use the ODBCParameter object, and the sourceColumn property contains a leading space...
Things don't work.
|
|
|
|
|
Hi,
I want to prevent the admin from being able to store 2 user records which both have the same username.
So far, I have pupulated a Dataset variable with the details, but I am unable to work it into an IF statement. Any suggestions??
Thank you
|
|
|
|
|
Have you tried ?:
string sql = @'
IF NOT EXISTS(SELECT * FROM foo WHERE user = @username) BEGIN
INSERT INTO foo (user) VALUES (@username)
SET @Success = 1
END ELSE BEGIN
SET @Success = 0
END';
bool bSuccess = false;
using(SqlConnection conn = new SqlConnection("connection string")){
SqlCommand cmd = new SqlCommand(conn, sql);
cmd.Parameters.Add("@username", SqlDbType.Varchar, 50);
cmd.Parameters.Add("@Success", SqlDbType.Bit);
cmd.Parameters["@username"].Value = DataSet.Tables[0].Rows[0]["Username"];
cmd.Parameters["@Success"].Direction = ParameterDirection.InputOutput;
conn.Open();
cmd.ExecuteNonQuery();
bSuccess = (bool) cmd.Parameters["@Success"].Value;
}
if(!bSucess)
{
//tell the user
}
|
|
|
|
|
Dear All,
I am bit new to this programmming world. Currently i am making web application using C# ,asp.net and sql. in a web page there i have listbox with multiple selection option. now with single option i am able to save the form data. but problem occur when there is multiple option. as i am confuge with how can i based on selection (no of selected data). i can save the record. please guide me.
thanks
regards
imran khan
|
|
|
|
|
I don't understand what you are trying to insert into the datbase. You have not said which database you are using (SQL is a languge that is used by pretty much all relational databases - Did you mean SQL Server?)
If you can give the code you currently have it might also help because there are many ways to put data in the database.
|
|
|
|
|
thanks for quick responce,
Actually there is agent master where i need to capture or display agent name,
Services he provides(listbox with multiple select option) and which branch he belongs to corresponding to agentid. Fine . Now One agent can provides any no. of services. so i have provides listbox with multiple select option. i need to save all this information.
my problem is how based on no. of selected listbox data. how can i save the all record. rightnow i saparated this infomation to two table. in one table
i am saving agentid, agentname, branchid, in other table i am saving service no of service. but i am confuged... in
1> how can i retrieve listbox data on save button.especially when there is nultiple records.
2> how can i display it back on edit command and save the changes.
i am using sql2000 along with asp.net and C#
please guide me
thanks
regards
imran khan
|
|
|
|
|
Hai,
Here are the Steps.
1)declare a string strListOptions="";
2)Now Iterate through the ListBoxItems
foreach(ListItem li in lbServices.Items)
{
if(li.Selected)
{
if(strListOptions.length>0)
{
strListOptions+=","+li.Index.ToString();
}
else
{
strListOptions+=li.Index.ToString();
}
}
}
3)Save the Agent Data and Return the AgentID.
4)Save the Services Altogether or individually in the Services Table with the AgentID.
While Retriving:
1)Loop through the records and loop through the list items and select the corresponding indexed listItem.
If you have any problem let me know.
You need to modify the same according to your conditions.
|
|
|
|
|
Hi, somebody know a .Net component able to describe a database using a graph or other browsable data structure thanks to ADO.net ?
I founded Component One DataObjects click here
Thanks !!!
-- modified at 6:22 Monday 8th January, 2007
|
|
|
|
|
Hi every one,
well I'm installing the SQL Server 2005 workgrp edition right now and I had its cd's image u know. well I have run the setup now and there is no sign of "SQL server management studio" in the menu. I selected all the components during the installation and when it scanned the system it showed me a warning that the system requirements are not fulfilled... I must tel u that I'm not upgrading from sql server 2000, its a completely new installation.
how do we know if its a 64 bit version or a 32 bit version.
and plz tell me where am I goin wrong here... is it something I'm missing or what?
well actually I never wanted to use sql 2005 at the first place, I was goin for sql 2000 workgrp ed. but it was not available any where here.
thanks in advance
Rocky
|
|
|
|
|
Can somebody tel me how to create user interface for query builder for select,insert,update,delete statement in asp.net using c#.net
abhijeet
|
|
|
|
|
|
I have a msde server bound to an application.
The application's purpose was to work into a lan, and all went well.
A special user (login) was created for the application use, gratend access to the appication databases, etc.
The problem occured when the database was made public (the computer was connected to the internet and the clients wore not from the lan).
I recive an error message about the inexistence of the server...
So I tried to conenct to the server by the "old way":
osql -S myserver.mydomain.ext -U myUser.
Doing this, the server prompts for a password, and wheater the password is good or wrong I recive the message about the inexistence of the server.
Can anybody help me?
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
How to insert the CheckBox Boolean Values into SQL database using 'SqlDbType.Bit' ...
vidya K.A
|
|
|
|