|
pankaj.indore wrote: If I having 15,000 records in combo then for loop will run 15,000 times and check the item.
Yes, when you have 15000 records in a combobox it's not right...but then again...why don't you do some filtering to have fewer values...or even...you should try to use autocomplete would work better
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Hi,
If you have already fill-in all the possible values in that combo, why not you make it un-editable? That way, still, the user will be able to select the value by pressing the 1st character key of the value. Correct me if i am wrong.
Regards,
Adeel
|
|
|
|
|
Hi Adeel,
You are right, But in this case only one letter searching is allowed and
My combo having more than 15,000 records and that will create a problem.
SO user can type first few starting letters of the name and then select the name.
In your case [DropDownList I suppose] you only have one letter search and that will take much time to search particular record.
Regards
Pankaj Joshi
|
|
|
|
|
use like this
bool chkitem_small = comboBox1.Items.Contains(comboBox1.Text.ToLower());
<pre>bool chkitem_cap = comboBox1.Items.Contains(comboBox1.Text.ToUpper());
if(chkitem_small == true | chkitem_cap == true)
{
}
else
{
}
Becoming Programmer...
|
|
|
|
|
That is working fine
Thanks for reply
Regards
Pankaj Joshi
|
|
|
|
|
hi,
Is it posible to use two diferent connection string in a SqlTransaction object??
Be very grateful for any advice.
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Hi,
I dont think it is possible to use two connection strings(CSs) at the same time!! But you should be able to use two different CSs 1 after the other. Like use CS-1 perform something in transaction close CS-1, then open CS-2 and use it with the same transaction object! That may be possible.
Regards,
Adeel
|
|
|
|
|
Thank you very much for your reply..
<br />
using (SqlConnection connection = DbConnection("SerConstr"))<br />
{<br />
using (SqlCommand command =<br />
connection.CreateCommand())<br />
{<br />
SqlTransaction transaction = null;<br />
<br />
try<br />
{<br />
connection.Open();<br />
<br />
transaction = connection.BeginTransaction();<br />
<br />
<br />
<br />
<br />
command.Transaction = transaction;<br />
<br />
<br />
<br />
command.CommandText = "Insert ...";<br />
command.ExecuteNonQuery();<br />
<br />
command.CommandText = "Update...";<br />
command.ExecuteNonQuery();<br />
<br />
transaction.Commit();<br />
}<br />
catch<br />
{<br />
transaction.Rollback();<br />
throw;<br />
}<br />
finally<br />
{<br />
connection.Close();<br />
}<br />
<br />
how I ll do this??
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Vipin.d wrote: // i need to perform this in con1
command.CommandText = "Insert ...";
command.ExecuteNonQuery();
// Execute i need to perform this in con2
command.CommandText = "Update...";
command.ExecuteNonQuery();
The insert and update queries refer to the same database, within the same server?
I will use Google before asking dumb questions
|
|
|
|
|
yes i know that ,
my requirement is I need to change the connection string before doing UPDATE process.is it have any solution??
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Can you please elaborate "Insert..." & "Update..." bit more? Like for what purpose you need to have two CSs? Do you want to change the database? If yes, why not do it as an intermediate SQL statement between insert & update?
|
|
|
|
|
Dear friend,
my rquiremnt is like
1. SELECT some data from servr1.db1.Tbl1
2. INSERT that to server2.db2.Tbl1.
3. UPDATE the status filed of selected data in servr1.db1.Tbl1
If either step 2 or 3 fail I need to Roll back that transaction.
any advice please..
Let me check intermediate SQL statement in my Google Uncle
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
First, allow me to clear this, I used "intermediate" as an english word, not as technical word.
Theoretically, it should be like that
connect with server1
select
if it was a success
connect with server2
insert
if it was a success
disconnect with server2
update
if not success rollback
disconnect with server1
Surely, you will need to have 2 connection objects, given this is not a live server with few hundereds transactions goin on.
Hope that helps!
Adeel
|
|
|
|
|
|
Why do you need 2 connection strings? What is the purpose..changing the database while the transaction is open?
I will use Google before asking dumb questions
|
|
|
|
|
Dear friend,
my rquiremnt is like
1. SELECT some data from servr1.db1.Tbl1
2. INSERT that to server2.db2.Tbl1.
3. UPDATE the status filed of selected data in servr1.db1.Tbl1
If either step 2 or 3 fail I need to Roll back that transaction.
any advice please..
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
The ConnectionString property can be set only when the connection is closed. (from MSDN) and when you close a query, the pending transactions are rolledback.
So...my suggestion is to use at least 2 connections
using (SqlConnection conn = new SqlConnection())
{
string cs1 = "connection string 1";
conn.ConnectionString = cs1;
conn.Open();
SqlTransaction trans = conn.BeginTransaction();
if (InsertSecondDB())
{
trans.Commit();
}
else
{
trans.Rollback();
}
conn.Close();
}
The InsertSecondDB should create a new connection and a new transaction to the second DataBase and return true if the query succeeded or false otherwise.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
defenitely it clicked some ideas in my mind..
Thank you soo much!!
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Dear friends,
During my g0ole search i got this
Distributed Transaction ^]
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
how to synchronize file on two pc
|
|
|
|
|
Hi,
There can be several ways, following are some possibilities:
1. Web-service
2. Application loaded in a hidden mode at the system start-up
In the 2nd option there can further be some possibilities as
2.a Client-Server sort of application for 2 PCs
2.b Instances of a same application on both PCs
2.c Event-Trigger sort of application, i.e. generating event and start sending changed/modified file from 1 PC to other
Hope that helps.
Regards,
Adeel
|
|
|
|
|
Hi,
Try looking at some flags of the open dialog.
Regards,
Adeel
|
|
|
|
|
is that no so...
i had seen the flags...
it should be custom control
chandru
|
|
|
|
|
Hello,
I need to find out programatically the encoding format of a text file.
Do text files, have a header which contains the encoding format.
If it does then how do I view it/access it ?
The encoding I am referring to is - ANSI, Unicode, UTF8, UTF4, etc.
Any help is appreciated.
Thanks,
\deepu
|
|
|
|
|