|
hi, regarding to an article I've read, adding Enlist=true parameter to connection string is enough to add that connection to the pool. I've done and didn't get any errors.Is it done now? Have I implemented the pool in the right way? because I didn't realize any difference
|
|
|
|
|
teknolog123 wrote: regarding to an article I've read
Know one knows what article you are talking about - could you post a link please?
|
|
|
|
|
in fact, I didn't mean to ask you to verify the correctness of the article. Instead, is it enough to add Enlist=true pm to implement the pool
|
|
|
|
|
I expect it has no effect on ADO.NET, which always wants to use a pool anyway, but I could be wrong.
Perhaps the database forum would be a better choice.
|
|
|
|
|
teknolog123 wrote: regarding to an article I've read, adding Enlist=true parameter to connection string is enough to add that connection to the pool. I've done and didn't get any errors.Is it done now?
I'm betting 2 cents that you're not referring to an article from CodeProject
The Enlist parameter isn't going to influence connection pooling[^]. I believe that pooling is the default behaviour for all providers, with the exception of ODBC.
I are Troll
|
|
|
|
|
i m using following code to set Datasource of gridview but its not working plz help
string path = Directory.GetCurrentDirectory();
string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\cricketdb.mdb";
OleDbConnection con = new OleDbConnection(conn);
OleDbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM countryinfo";
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet("countryinfo");
OleDbCommandBuilder oldbcbr = new OleDbCommandBuilder(da);
da.Fill(ds, "countryinfo");
dataGridView1.DataSource = ds;
comboBox2.DataSource = ds.Tables["Country_Name"];
listBox1.DataSource = ds.DefaultViewManager;
listBox1.DisplayMember = "Country_Name";
dataGridView1.DataSource = ds;
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
comboBox2.DataSource = dt;
Its also not setting datasource of anycontrol like combo or list plz help
|
|
|
|
|
Is it shows any error ?
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
No it does not compiles any error but display nothing in gridview
|
|
|
|
|
shaina2231 wrote: comboBox2.DataSource = ds.Tables["Country_Name"];
what is Country_Name ?
I think you have to use instead
comboBox2.DataSource = ds.Tables[0];
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
Hi,
I am using webclient while uploading large file(135MB) using windows application. My Code works but when it reaches to stream.close() it showing following error
Error:-
The CLR has been unable to transition from COM context 0x1ff030 to
COM context 0x1ff1a0 for 60 seconds. The thread that owns the destination
context/apartment is most likely either doing a non pumping wait or processing
a very long running operation without pumping Windows messages. This situation
generally has a negative performance impact and may even lead to the application
becoming non responsive or memory usage accumulating continually over time.
To avoid this problem, all single threaded apartment (STA) threads should use
pumping wait primitives (such as CoWaitForMultipleHandles) and routinely
pump messages during long running operations.
So because of that my file is not uploaded. what is the problem?
My Code is:-
WebClient client = new WebClient();
Stream stream = client.OpenWrite(remoteFilename, "PUT");
// The buffer size is set to 2kb
const int buffLength = 2048;
byte[] buff = new byte[buffLength];
int contentLen;
// Opens a file stream (System.IO.FileStream) to read the file
// to be uploaded
FileStream fs = fileInf.OpenRead();
int doneSoFar = 0;
// Read from the file stream 2kb at a time
contentLen = fs.Read(buff, 0, buffLength);
//added for accurate progress
doneSoFar += contentLen;
setItemStatus("Uploading");
while (contentLen != 0)
{
setItemProgress(doneSoFar, fileInf.Length);
// Write Content from the file stream to the FTP Upload Stream
stream.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, buffLength);
doneSoFar += contentLen;
}
// Close the file stream and the Request Stream
stream.Close();
fs.Close();
Thanks
sjs
|
|
|
|
|
First, please format any code you post using the pre tags.
Have you tried just using WebClient.UploadFile or WebClient.UploadFileAsync ?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ok. Let me specify what I am actually doing.
I am using windows application for uploading file on server. My client applications were using by our various CLIENT's. In that I am using one folder where there will be more files in that and once CLIENT's finish there work they save it to that folder. then by using threading concept I am fetching all the files and uploaded on the server. Also in that I need to check the size of files that is being uploaded on the server.
In that I dont want to set some credential like username and password.
By using your solution webclient.uploadfile() is this will work.
How can i use Webclient.UploadfileAsync?
Thanks
sjs
modified on Saturday, April 10, 2010 7:38 AM
|
|
|
|
|
sjs4u wrote: Let me specify what I am actually doing.
That would have nice to do in the first post.
sjs4u wrote: webclient.uploadfile() is this will work.
Why?
sjs4u wrote: How can i use Webclient.UploadfileAsync?
RTFM
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
webclient.uploadfile() :- for This should I have to write credential? Right Now my path is http://loacalhost/server/file.wav.
as i m uploading .wav file.
Why I am saying that I want to use same code only for uploading the file.
I will check..Thanks
|
|
|
|
|
sjs4u wrote: want to use same code only for uploading the file.
What???
sjs4u wrote: This should I have to write credential?
Why? Does the website you are posting to require login?
sjs4u wrote: I will check
This is the only part of your response that makes sense
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have two textbox BP_S and BP_D
how can I make sure if one textbox is not null then the other should not be null as well... && and || won't worked I guess..
|
|
|
|
|
There is no room for guessing in software development.
bool isBad = text1!="" && text2==""
[CORRECTION: TextBox.Text never is null, it is an empty or a non-empty string]
|
|
|
|
|
There is no room for guessing in software development.
I have to mark it.. you are right...
|
|
|
|
|
I prefer this for String type:
bool isBad = ((String.IsNullOrEmpty(text1) == true) || (String.IsNullOrEmpty(text2)))
My 2 cents
|
|
|
|
|
Why are your textboxes null to begin with? How about if (BP_S != null && BP_D != null) ? Or did you mean that it is ok for the second textbox to be null as long as the first textbox is null as well: if (BP_D != null || BP_S == null) ?
(this is not help, btw, it's a bunch of questions)
|
|
|
|
|
no i mean:
if the user entered BP_S then he MUST enter BP_D
similarly, if the user entered BP_D then he MUST enter BP_S
but user can leave both BP_S and BP_D as NULL
|
|
|
|
|
Ok so more like this: if (BP_S.Text.Length == 0 || BP_D.Text.Length != 0) ?
|
|
|
|
|
yes but this code will force the user to enter one of the textbox.. What if the user wants to leave the null?
|
|
|
|
|
Ok it's quite late here and I'm tired so I could be wrong, but I'm fairly certain that if they are both null, that condition will evaluate to true
|
|
|
|
|
it's ok.. rest now I will also sleep and come back later... it's 1:30am here in Bahrain.. Sweet Dreamz
|
|
|
|