|
Does the kind of surface affect Bluetooth or USB connectivity?
|
|
|
|
|
We are speaking of a Microsoft mouse... I can believe anything...
|
|
|
|
|
No, but if the mouse is not sensing the surface correctly, it won't communicate correctly regardless of how its connected (wired or wireless).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I am trying to insert record into two tables and fetch the UserId of first table and insert into another column of the same table and also into another table but it appears that when I insert data into the tables, the Id of the user is returned and inserted into the second table but inserted a different interger into another column of same first table.
For example, I have UserTable and WalletTable and I want to insert records simultaneously into the two tables and at the same time fetch the Id of UserTable and insert into columns of both tables.
Here is the structure of the first Table: I want to fetch “UserID” in UserTable and insert into “CreatedBy” of UserTable and UserID of WalletTable. But after inserting I discovered that interger “-1” is inserted in CreatedBy column of UserTable and on WalletTable the correct UserID is inserted. How can I correct this please?
UserTable:
UserID | email | pass | con_pass | UserRole | Name | CreatedBy | image | CreateDate |
WalletTable:
Id | UserID | email | Name | amount |
Here is my Insert code (C#)
if (mailtxtbx.Text != "" & pass.Text != "" & conpass.Text != "" & txtname.Text !="")
{
if (pass.Text == conpass.Text)
{
if (Filedoc.PostedFile.FileName != "")
{
if (check1.Checked)
{
int Uid = -1;
byte[] image;
Stream s = Filedoc.PostedFile.InputStream;
BinaryReader br = new BinaryReader(s);
image = br.ReadBytes((Int32)s.Length);
string query = @"INSERT INTO Users (email, pass, con_pass, UserRole, Name, CreatedBy, image, CreateDate) VALUES (@email, @pass, @con_pass, @UserRole, @Name, @CreatedBy, @image, @CreateDate);
SELECT SCOPE_IDENTITY();";
using (SqlCommand objCMD = new SqlCommand(query, con))
{
objCMD.Parameters.Add("@email", SqlDbType.VarChar, 50).Value = mailtxtbx.Text.Trim();
objCMD.Parameters.Add("@pass", SqlDbType.VarChar, 100).Value = pass.Text.Trim();
objCMD.Parameters.Add("@con_pass", SqlDbType.VarChar, 50).Value = conpass.Text.Trim();
objCMD.Parameters.Add("@UserRole", SqlDbType.VarChar, 50).Value = 'A';
objCMD.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = txtname.Text.Trim();
objCMD.Parameters.Add("@CreatedBy", SqlDbType.Int, 50).Value = Uid;
objCMD.Parameters.Add("@image", SqlDbType.VarBinary).Value = image;
objCMD.Parameters.Add("@CreateDate", SqlDbType.DateTime, 100).Value = DateTime.Now;
con.Open();
object returnObj = objCMD.ExecuteScalar();
if (returnObj != null)
{
int.TryParse(returnObj.ToString(), out Uid);
}
cmd.ExecuteNonQuery();
}
con.Close();
if (Uid > 0)
{
query = @"INSERT INTO UserWallet (Uid, email, Name, amount) VALUES (@Uid, @email, @Name, @amount)";
using (SqlCommand objCMD = new SqlCommand(query, con))
{
objCMD.Parameters.Add("@Uid", SqlDbType.Int, 50).Value = Uid;
objCMD.Parameters.Add("@email", SqlDbType.VarChar, 50).Value = mailtxtbx.Text.Trim();
objCMD.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = txtname.Text.Trim();
objCMD.Parameters.Add("@amount", SqlDbType.Float, 100).Value = 0;
con.Open();
object returnObj = objCMD.ExecuteScalar();
if (returnObj != null)
{
int.TryParse(returnObj.ToString(), out Uid);
}
cmd.ExecuteNonQuery();
lblsuccess.Visible = true;
Div1.Visible = true;
lblsuccess.Text = "Successfully Signed Up";
lblsuccess.ForeColor = System.Drawing.Color.Green;
lblMessage.Visible = false;
dvMessage.Visible = false;
mailtxtbx.Text = "";
pass.Text = "";
conpass.Text = "";
txtname.Text = "";
}
}
con.Close();
}
|
|
|
|
|
Be prepared for ironic comments.
From my side, better ask this here: https://www.codeproject.com/Questions/ask.aspx[^]
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I would handle odd numbers a different way than even numbers and add a special case for prime numbers.
|
|
|
|
|
Why is it that some people can't read? Or can't be bothered if they can read?
How much clearer does the text at the top of the page have to be, to prevent people posting coding questions where they are specifically excluded - one of three pages on the entire site where programming questions are not wanted?
And yet, here we go again. Another day, another programming question.
Please note that I didn't at any point describe the question poster in any way, shape, or form; and the total absence of any abuse towards the OP, particularly obscene or derogatory terms. But ... quite a few descriptive words did cross my mind while typing this ... and some of them may have fallen in both camps.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
From my point of view it is enough (especally for new members) to point out that the lounge is the wrong forum and mention what the right place is.
No need to make any ironic/sarcastic comments.
Only my 2 cents.
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
0x01AA wrote: No need to make any ironic/sarcastic comments. But where's the fun in that?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
Actually, as it turns out, it is a need.
Not only because it helps foster a feeling of community, but likely most important of all, Because We Can!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
We're in a "lounge", not church.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
"We" can also become same arrogant like SO
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
OP is / was in the lounge ... your point is invalid. He is one of "we".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Yes yes. Time for me to say good by here at CP. Only tried to help...
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
He has been here since early May and already has 3 QA's.
|
|
|
|
|
I can remember several cases where multi-year members were unintentionally wrong in the forum
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
He has paid enough attention to be able to format the code properly... that's already something
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
OriginalGriff wrote: How much clearer does the text at the top of the page have to be Actually, it's not clear at all. New Discussion is in a big red box. That will get most of your eye attention.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Now look at how you get to it.
You'll be starting - probably - fro the home page, where "Ask a question" is in much larger letters on a Green background. Ignore that, it's probably relevant.
Then where shall I go? "Quick answers"? Nah ... too obvious.
"Discussions"? Nah. Just relevant forums and such.
"Community"? I dunno ... "The Lounge". That's the perfect place!
If you are searching for anything to do with a programming question, you land on a QA page or a relevant forum. Landing on the lounge takes actual effort for a newby - so why do they end up here and posting programming questions?
I'm guessing because they think they are far too important to have rules affect them ... but I could be wrong.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Landing on the lounge takes actual effort for a newby Actually no, the Community menu item links right to the Lounge. "Community" is the same term other sites use for the developer forums.
It happens often enough that you should realize it is not as clear as some of you think it is.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Quote: Actually, it's not clear at all. New Discussion is in a big red box. That will get most of your eye attention.
Exactly
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|
|
What does this have to do with clipping toe nails?
I just don't get the connection - please explain.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Georgeakpan13 wrote: Here is my Insert code (C#) I think it would be better formatted and more readable if you converted it to Shakespeare!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
At the top of the forum page there is a phrase in red letters. That is a clickable link and the it leads to the best place for your question.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
at least one reasonable here
It does not solve my Problem, but it answers my question
Chemists have exactly one rule: there are only exceptions
modified 19-Jan-21 21:04pm.
|
|
|
|