Click here to Skip to main content
15,903,856 members
Home / Discussions / Database
   

Database

 
GeneralRe: ALTER TABLE ALTER COLUMN IDENTITY,help me Pin
Mike Dimmick16-Oct-03 5:03
Mike Dimmick16-Oct-03 5:03 
GeneralRe: ALTER TABLE ALTER COLUMN IDENTITY,help me Pin
Anonymous19-Oct-03 14:55
Anonymous19-Oct-03 14:55 
GeneralHighlighting a datagrid row based on condition Pin
Anonymous15-Oct-03 14:49
Anonymous15-Oct-03 14:49 
GeneralLoooping through SELECT values in SQL Pin
mittalpa15-Oct-03 10:59
mittalpa15-Oct-03 10:59 
GeneralRe: Loooping through SELECT values in SQL Pin
Mike Dimmick16-Oct-03 5:14
Mike Dimmick16-Oct-03 5:14 
GeneralRe: Loooping through SELECT values in SQL Pin
Arjan Einbu18-Oct-03 9:44
Arjan Einbu18-Oct-03 9:44 
GeneralRe: Loooping through SELECT values in SQL Pin
mittalpa20-Oct-03 10:09
mittalpa20-Oct-03 10:09 
GeneralHelp! Test of SQL Server's scalability Pin
yyf15-Oct-03 10:34
yyf15-Oct-03 10:34 
Hi,

I am writing a small program to test the scalability of SQL Server. My code is:

class MyClass<br />
{<br />
	string sql = "select * from table1";<br />
	string conn_s = "...";<br />
	<br />
		private bool threadFail = false;<br />
		private bool ThreadFail <br />
		{<br />
			get <br />
			{<br />
				lock ( this ) <br />
				{<br />
					return threadFail;<br />
				}<br />
			}<br />
			set<br />
			{<br />
				lock ( this ) <br />
				{<br />
					threadFail = value;<br />
				}<br />
			}<br />
		}<br />
<br />
		private void DoQuery()<br />
		{<br />
			DataSet ds = new DataSet();<br />
			OleDbDataAdapter da = new OleDbDataAdapter(sql, conn_s);<br />
<br />
			while ( !ThreadFail ) <br />
			{<br />
				try <br />
				{<br />
					da.Fill(ds);<br />
					Thread.Sleep(100);<br />
				} <br />
				catch ( Exception e ) <br />
				{<br />
					ThreadFail = true;<br />
				}<br />
			}<br />
		}<br />
<br />
		public void Test()<br />
		{<br />
			int i = 0;<br />
			while ( !ThreadFail ) <br />
			{<br />
				i++;<br />
				Thread t = new Thread(new ThreadStart(DoQuery));<br />
				t.Start();<br />
				Thread.Sleep(100);<br />
			}<br />
			ShowMessage( "Total threads = " + i );<br />
		}<br />
}


However, there's a problem. It threw an exception of without enough memory. I think it's because of "da.Fill(ds)". It occupied a lot of memory every time. What I want to know is: can I use OleDbCommand.ExecuteReader() instead of OleDbDataAdapter.Fill()? And I don't get the data from sqlserver. But I am not sure if the OleDbCommand.ExecuteReader() already run the sql command in SQL Server? Because I need the query to be executed but I don't want the return data.

Anyone has any idea? Thanks in advance!
GeneralRe: Help! Test of SQL Server's scalability Pin
Guillermo Rivero15-Oct-03 13:21
Guillermo Rivero15-Oct-03 13:21 
GeneralRe: Help! Test of SQL Server's scalability Pin
yyf16-Oct-03 3:22
yyf16-Oct-03 3:22 
GeneralQuery Pin
Anonymous15-Oct-03 6:36
Anonymous15-Oct-03 6:36 
GeneralMSAccess system tables & ADO.NET Pin
Armen Dalaliants15-Oct-03 6:28
Armen Dalaliants15-Oct-03 6:28 
GeneralImport Stored Procedure Pin
Richard Hudson15-Oct-03 5:19
Richard Hudson15-Oct-03 5:19 
GeneralRe: Import Stored Procedure Pin
Mike Dimmick16-Oct-03 5:08
Mike Dimmick16-Oct-03 5:08 
Generalforeign key Pin
Anonymous15-Oct-03 4:32
Anonymous15-Oct-03 4:32 
GeneralKill Sleeping Database Connections in SQL Server Pin
Altafqau15-Oct-03 0:17
Altafqau15-Oct-03 0:17 
GeneralRe: Kill Sleeping Database Connections in SQL Server Pin
Sage16-Oct-03 11:18
Sage16-Oct-03 11:18 
GeneralRe: Kill Sleeping Database Connections in SQL Server Pin
Altafqau16-Oct-03 23:49
Altafqau16-Oct-03 23:49 
GeneralADO and Pro-C Pin
WoonLeng13-Oct-03 19:56
WoonLeng13-Oct-03 19:56 
QuestionUpload File into SQL Server? Pin
DudleyDoorite13-Oct-03 4:34
DudleyDoorite13-Oct-03 4:34 
GeneralDataRow/DataGrid filter question. Pin
TravisMerkel12-Oct-03 13:06
TravisMerkel12-Oct-03 13:06 
GeneralRe: DataRow/DataGrid filter question. Pin
Armen Dalaliants16-Oct-03 4:02
Armen Dalaliants16-Oct-03 4:02 
GeneralSQL syncing Pin
Judah Gabriel Himango10-Oct-03 6:10
sponsorJudah Gabriel Himango10-Oct-03 6:10 
GeneralRe: SQL syncing Pin
Rob Graham10-Oct-03 12:32
Rob Graham10-Oct-03 12:32 
GeneralSQL syncing Pin
Guillermo Rivero13-Oct-03 3:34
Guillermo Rivero13-Oct-03 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.