|
Tunisien86 wrote: and also the step
That's a different step from your original code, which holds the line
adapter.Fill(ds, "SQL Temp Table"); Check your select-statement, or post it here.
I are Troll
|
|
|
|
|
Hi,
my select statement is:
sql = "Select login from Connexion where login=@login and MotPass=@MotPass ";
Also i wanna now how to deal with the result of the
ds.Tables("Connexion").Rows.Count) - 1
Thank u
|
|
|
|
|
Tunisien86 wrote: Select login from Connexion where login=@login and MotPass=@MotPass
Doesn't this statement return NULL if the login doesn't exist? Btw, filling a dataset is a bit superfluous if you're only interested in the result of the query. There's a ExecuteScalar method that returns the first value of the first row.
Tunisien86 wrote: Also i wanna now how to deal with the result of the
I do not understand what you are asking; that line in the original post evaluates an expression to a boolean, and takes an action based on that bool.
I are Troll
|
|
|
|
|
Hi,
This is the code that solved my problem:
private void button1_Click(object sender, EventArgs e)
{
string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
SqlCeConnection sqlceconn = new SqlCeConnection(wCS);
SqlCeCommand command = sqlceconn.CreateCommand();
command.CommandText = "Select login from Connexion where Login=@Login and MotPasse=@MotPasse ";
string s1=textBox1.Text;
SqlCeParameter Login = new SqlCeParameter("@Login", SqlDbType.NVarChar);
Login.Value = s1;
string s2=textBox2.Text;
SqlCeParameter MotPasse = new SqlCeParameter("@MotPasse", SqlDbType.NVarChar);
MotPasse.Value = s2;
command.Parameters.Add(Login);
command.Parameters.Add(MotPasse);
SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);
DataSet ds = new DataSet();
try
{
adapter.Fill(ds, "SQL Temp Table");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
if ((ds.Tables.Count > 0) && (ds.Tables["SQL Temp Table"] != null))
{MessageBox.Show("Number of row(s) - " + ds.Tables["SQL Temp Table"].Rows.Count);
if(ds.Tables["SQL Temp Table"].Rows.Count>0)
{ MessageBox.Show("Authentification réussie");
MenuP m = new MenuP();
m.Show();}
else MessageBox.Show("Login ou mot de passe incorrect veuillez réessayer");}
adapter.Dispose();
sqlceconn.Dispose();
command.Dispose();
}
Thank u a lot for u contribution
|
|
|
|
|
Tunisien86 wrote: This is the code that solved my problem
Good to see that you got your connectionstring fixed and good to have the solution on the board as a future reference
I are Troll
|
|
|
|
|
hii,
i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.
|
|
|
|
|
My suggestion is, don't bind to the combo box. 134000 is plainly too many items for the user to look through. You will be much better off providing the user with the ability to search for an item.
Also, it's considered bad form to write "it's urgent" in message boards posts (kindly read the FAQs), as it is only urgent to you.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
sudhir behera wrote: 134000 records in my ... combo box
|
|
|
|
|
Oh sh*t, I needed a good laugh. Now I have to try and explain that the the significant other.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
sudhir behera wrote: opening the page.it is taking 45 seconds to load data from sql serer into combo box
I'm surprised you did not get an "out of memory" error or something.
I dont think the user is going to like scrolling through soooo many records - think of a different strategy - dont use a combo box.
|
|
|
|
|
sudhir behera wrote: have 134000 records ... binded ... in the combo box
There's no fix for "stupid". Your best hope is that a competent programmer take over the project.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I looked at Luc's first because it had a 5 vote... and cracked up, ahh I enjoyed that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm just callin' 'em like I see 'em...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Alas; artificial intelligence is no match for organic stupidity.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I too giggled the first time I saw this posting and now I am in a similar predicament. I have a client who has had enough of the data entry errors his staff constantly makes while entering chemical names by hand. So we have a combo box with an autofill function, so if they type 'Alc' the combobox will display all records that start with 'Alc'.
There are 3 of these combo boxes each one with over 25,000 items. The page takes 4 seconds in loading. The client is happy, I of course i'm not.
|
|
|
|
|
sudhir behera wrote: please help me how will make it faster
By loading a lot less data.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Try using a System.Terror to load the datas.
OK, really bad design. You should let the user search or at least provide some sort of paging or...
- But, as a small improvement to whatever you have, you could unbind the combo,
get all the datas in a array of strings using a datareader then use the Items.AddRange();
- also wraping the whole filling of the combo in a
"comboBox1.BeginUpdate(); ... comboBox1.EndUpdate); " should help a little.
Again, bad design.
But still 45 secs seems way to much for 134000 strings/records.
|
|
|
|
|
Hi . I have xml file .
XmlWriter writer = XmlWriter.Create(path + "\\playbackmanu.xml");
writer.WriteStartDocument();
writer.WriteStartElement("PlayBack");
for(int i=1;i<=nCount;i++)
{
writer.WriteStartElement("ItemInfo");
writer.WriteElementString("itemimgpath","img"+ i.ToString() + ".jpg");
writer.WriteElementString("itemname", "");
writer.WriteElementString("itemtitle", "Title "+i.ToString());
writer.WriteElementString("itemcommand",i.ToString());
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
------------------------------------------------------------
#PlayBack#
#ItemInfo#
#itemimgpath#img1.jpg#/itemimgpath#
#itemname##/itemname#
#itemtitle#Title 1#/itemtitle#
#itemcommand#1#/itemcommand#
#/ItemInfo#
#ItemInfo#
#itemimgpath#img2.jpg#/itemimgpath#
#itemname##/itemname#
#itemtitle#Title 2#/itemtitle#
#itemcommand#2#/itemcommand#
#/ItemInfo#
#/PlayBack#
# is < and >
--------------------------------------------------------------
How i can add atribute first node ?
#PlayBack testAtribute="Hello world"#
Thanks.
We are haven't bug,just temporarily undecided problems.
modified on Wednesday, April 14, 2010 6:24 AM
|
|
|
|
|
Just after writer.WriteStartElement("PlayBack");
writer.WriteAttributeString("testAtribute", "Hello world");
Good luck
|
|
|
|
|
|
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Thanks
Nematjon Rahmanov wrote: We are haven't bug,just temporarily undecided problems
It's not a bug, it's a feature!!!
FTFY
I hate signatures, but I love 5's
|
|
|
|
|
FYI you can use < (<) and > (>) in your posts instead of #
That would make it a bit clearer IMO
|
|
|
|
|
Hi,
I am currently using bing maps. There is one text box and a search button which will find the location on bing maps.
I have already done with that, it is finding the location properly, when i enter the location/address in textbox and click on the search button.But, i want to mark that location using polygon shape.
It means when i enter the address in textbox and hit the search button it will find the desired location and mark that area in polygon or circle shape.
How can i achieve that. Can any one provide me some code or some useful link which can help me out.
regards,
Pranav dave.
Pranav Dave
|
|
|
|
|
I friends, I made a simple program that use Drag&Drop event.
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
String str = (String)e.Data.GetData(DataFormats.StringFormat);
textBox1.Text = str;
}
When i run the program under windows7 the Drag&Drop event doesn't function, but the same program under WindowsXP, function.
Could anyone explain why there is this problem?
Thank you.
Bye Bye
|
|
|
|