15,906,766 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by manish7664 (Top 49 by date)
manish7664
15-Feb-18 9:55am
View
thnx F-ES
manish7664
4-Feb-18 9:20am
View
its working in parameter query ..
thnx OriginalGriff..
manish7664
11-Apr-14 13:37pm
View
Thanks Mr. Bernhard for reply. i have modified my code as per your suggestion but when i click on save button then one error coming.
Error ---> Object reference not set to an instance of an object.
Error line ---> command.CommandText = "SELECT @@IDENTITY As myInsertID";
manish7664
11-Apr-14 1:50am
View
datatype of id is int.
manish7664
9-Apr-14 7:27am
View
sorry sir but i want c# code.
MessageBox.Show("Your ID No. is- ");
private void Save_Click(object sender, EventArgs e)
{
conn = new SqlConnection(@"Data Source..........");
conn.Open();
SqlCommand command = new SqlCommand();
command.CommandText = "insert into test(name)values('" + textBox2.Text + "'")";
command.Connection = conn;
command.ExecuteNonQuery();
MessageBox.Show("Your ID No. is- ");
}
manish7664
8-Apr-14 0:02am
View
Thanks Mr RyanDev.
manish7664
7-Apr-14 15:02pm
View
sir now i used this but it's also not working...
comm.CommandText = "update timeatten set timeout='" + textBox2.Text + "' where id='" + comboBox1.Text + "'";
manish7664
7-Apr-14 14:50pm
View
insert query working fine-->
comm.CommandText = "insert into timeatten (id,name,timein)values('" +comboBox1.Text+"','"+textBox1.Text+"','"+textBox2.Text+"' )";
update query execute successfully but database not updated....
comm.CommandText = "update timeatten set id='" + comboBox1.Text + "' where timeout='" + textBox2.Text + "'";
please help...
manish7664
7-Apr-14 14:17pm
View
Deleted
private void checkin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source............");
conn.Open();
SqlCommand comm = new SqlCommand();
comm.CommandText = "insert into timeatten (id,name,timein)values('" +comboBox1.Text+"','"+textBox1.Text+"','"+textBox2.Text+"' )";
comm.Connection = conn;
comm.ExecuteNonQuery();
MessageBox.Show("Successfully check in");
conn.close();
}
private void checkout_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source.............");
conn.Open();
SqlCommand comm = new SqlCommand();
// UPDATE QUERY PLEASE........
MessageBox.Show("Successfully Checkout");
conn.close();
}
manish7664
7-Apr-14 13:57pm
View
thanks for reply . i had used same code in timeout button but Timeout time saving in new row.
like...
Id Name timein timeout
1 A 09:15:34 AM NULL
1 A NULL 05:17:10 PM
I want this ....
Id Name timein timeout
1 A 09:15:34 AM 05:17:10 PM
manish7664
3-Apr-14 2:14am
View
i used below code and it's working fine. Thanks once again both of you.
int comboxchoice = Convert.ToInt32(comboBox1.SelectedIndex);
command.Parameters.AddWithValue("@id", comboxchoice);
textBox1.Text = comboBox1.SelectedValue.ToString();
manish7664
2-Apr-14 9:11am
View
Deleted
sir i tried Int32.TryParse(comboBox1.Selectedvalue.ToString(), out comboxchoice);
textBox1.Text = comboBox1.SelectedValue.ToString(); and selecteditem also
but problem nt slove. i trying to solve this problem last 5-6 hrs.i request you that please do necessary correction in my code...
manish7664
2-Apr-14 8:45am
View
if i do so then what value i select from combox same value showing in taxtbox.
i want if i select 1 then manish (Column Value) should show in textbox.
manish7664
2-Apr-14 8:21am
View
i want to change the text box values according to the combo box selection.
below code Execute fine but when i select id from combobox then "System.Data.DataRowView" show in textbox instead of database value.
could you please help me what's wrong in my code....
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=MANISH-PC\SQLEXPRESS;Initial Catalog=test2.mdf;Integrated Security=True");
conn.Open();
SqlCommand command = new SqlCommand("select name from table1 where id=@id", conn);
int comboxchoice;
Int32.TryParse(comboBox1.SelectedItem.ToString(), out comboxchoice);
command.Parameters.AddWithValue("@id", comboxchoice);
SqlDataAdapter adp = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adp.Fill(ds, "table1");
textBox1.Text = comboBox1.SelectedValue.ToString();
}
manish7664
2-Apr-14 7:44am
View
now my code run successfully but i have one problem when i select id from combobox then "System.Data.DataRowView" showing in textbox instead of database value.
i request you that please tell me what mistake i am doing in code....
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=MANISH-PC\SQLEXPRESS;Initial Catalog=test2.mdf;Integrated Security=True");
conn.Open();
SqlCommand command = new SqlCommand("select name from table1 where id=@id", conn);
int comboxchoice;
Int32.TryParse(comboBox1.SelectedIndex.ToString(), out comboxchoice);
command.Parameters.AddWithValue("@id", comboxchoice);
SqlDataAdapter adp = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adp.Fill(ds, "customer");
textBox1.Text = comboBox1.SelectedValue.ToString();
}
manish7664
2-Apr-14 2:51am
View
Thanks Mr Maciej and Mr Richard. but int32.tryparse not taking here.
int comboxchoice = Int32.TryParse(comboBox1.SelectedItem.ToString());
command.Parameters.AddWithValue("@id", comboxchoice);
manish7664
1-Apr-14 15:47pm
View
Mr Richard guide me how can i remove Input string was not in a correct format error
manish7664
1-Apr-14 15:29pm
View
Thanks for reply. I made changes as per your suggestion but it's showing error
Error -Input string was not in a correct format.
manish7664
30-Mar-14 7:34am
View
please help
manish7664
30-Mar-14 3:45am
View
if i'nt do this then only first row save.
manish7664
30-Mar-14 3:39am
View
i have selected all field null except id and name .
manish7664
30-Mar-14 3:33am
View
s
manish7664
26-Mar-14 10:01am
View
Thanks you so much.....
manish7664
26-Mar-14 9:35am
View
Mr Raul . i need your help.
i have two form.in first form have two textbox and one find button and second form have one datagrid.
i want when i click form 1 find button then form 2 datagrid open and if i click any perticular datagrid records cell then selected record show in form 1 textbox
i use below code but not working .
// Form 1
private void cmdfind_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.Show();
}
//Form 2
private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
Form2 form2 = new Form2();
DataGridViewRow row = dataGridView1.Rows[e.RowIndex];
form2.textBox1.Text = row.Cells[0].Value.ToString();
form2.textBox2.Text = row.Cells[1].Value.ToString();
}
manish7664
26-Mar-14 1:41am
View
Mr Nirdesh .i am not able to used textbox1 and textbox2 in form 2.
here one error coming with red bottom line -->
Error--> only assignment,call,increment,decrement,and new object expression can be used as a statement
manish7664
24-Mar-14 9:24am
View
Thanks but it's not working
manish7664
24-Mar-14 8:38am
View
Deleted
Not clear . could you use my program code for this. so i can easily understand.
manish7664
24-Mar-14 8:29am
View
Mr Arun Thanks for reply. but if i used sqldataadpter adp= new data... outside
then one error coming.
manish7664
24-Mar-14 8:15am
View
where {0}='{1}'" could you please explain..
manish7664
24-Mar-14 4:52am
View
Thanks
manish7664
22-Mar-14 14:24pm
View
if i remove refreshdata() from from load then nothing show in form textbox.
now could you please tell me what's the problem.
manish7664
22-Mar-14 14:20pm
View
i chked no records in database . if i remove refreshdata() from Form load then nothing show in form textbox.
manish7664
22-Mar-14 9:43am
View
hi. I have a MainForm that have some textbox and combobox and one Datagridview that datagrid linked to my database table.
i want, when i insert a new record at that time Datagridview show new record information automaticaly by Pushing the button(Save New Record.)
that's my question.
manish7664
20-Mar-14 8:06am
View
Thank you notnitrial.
manish7664
19-Mar-14 15:50pm
View
it is possible to cast one control in three time .i've simple used this and it's working fine
foreach (Control cntl in this.Controls)
{
if (cntl is TextBox || cntl is ComboBox || cntl is RichTextBox)
{
cntl.Text = string.Empty;
cntl.Text = string.Empty;
cntl.Text = string.Empty;
}
}
manish7664
19-Mar-14 15:24pm
View
thanks for reply . but i want to ask one thing why we can give one control in textbox,combobox and richtext.
what the differance in both condition
if (cntl is TextBox && cntl is ComboBox && cntl is RichTextBox) and
if (cntl is TextBox)
{
//code
}
if(cntl is combobox)
{
//code
if (cntl is richtextbox )
{//code
}
manish7664
19-Mar-14 15:17pm
View
Unable to cast object of type 'System.Windows.Forms.TextBox' to type 'System.Windows.Forms.ComboBox
manish7664
19-Mar-14 14:53pm
View
not working...
manish7664
19-Mar-14 14:52pm
View
Thanks Mr Marcin .your code working fine. but i want to ask one thing you also using same controls (cntl) in multiple if condition.
manish7664
19-Mar-14 14:27pm
View
you also doing same thing . the diff. is you are giving same condition in multiple if block.
manish7664
19-Mar-14 14:21pm
View
Deleted
Thanks Mr Shiva.
manish7664
19-Mar-14 8:53am
View
i am newly in c#. could you please tell me how can move records without using [i].
Thanks in advance
manish7664
19-Mar-14 8:45am
View
Mr Jawad first thanks for your reply. could you please explain wht's the differance if i declare "datatable tbl= new datatable()" inside of form block or declare inside of button_click block.
manish7664
19-Mar-14 5:38am
View
Deleted
thanks Mr. billwoodruff for reply.
manish7664
19-Mar-14 5:23am
View
Deleted
Thanks Mr Meysam for reply.
manish7664
19-Mar-14 5:19am
View
Deleted
Thanks Mr. Bill woodruff.
manish7664
19-Mar-14 4:13am
View
5 records in mydatabase.
manish7664
19-Mar-14 4:03am
View
no error. 2nd form successfully loaded but records not showing from database to form textbox.
manish7664
16-Mar-14 5:52am
View
Thank You
Show More