As Jorge mentions, it seems like you accidentally zoomed out in Chrome. From the Tools menu, click Zoom to 100%. You can also hold down the Ctrl key and scroll the mouse up.
This was partly true, but not the zoom that was doing problems, in new chrome there is an icon beside zoom, just clicked on it, and now its all fine :)
And thx for your decent explanation. I hope daniweb returns to its best days :)
Hi, since this forum has been modified majorly (this happened approx. 6 months ago) nothing works at it should. There is a lot less people asking question (and answering on them), it seems like you have driven them away with these (not-good changes -personally it was whole much better before that huge webiste update), nor the forum it self does not work like it should.
And a few days ago (including today) the forum size has been shrinked, redused to some small size (like 600x400 pixels). This is refering to Chrome web browser, in Opera seem to be all ok. What is going on here?
I just want to remind you, if this is keep on happening, people will go from here (leaving), to other forums. Just to keep you awake, I dont think nothing bad with this few statements of mine! I hope I will wake you up moderators and people who are responsable for this (used to be) great forum!
Do the loop through the rows of dgv and check if row is selected:
using(SqlConnection conn = new SqlConnection("connString"))
foreach (DataGridViewRow dr in dataGridView2.Rows)
DataGridViewCheckBoxCell check = row.Cells as DataGridViewCheckBoxCell;
if(check != null && (bool)check.Value) //1st parameter must not be null, 2nd parameter must me true!
string query = @"UPDATE TableName SET FieldName2 = @param1 WHERE FieldName1 = @param2"; //query
using(SqlCommand cmd = new SqlCommand(query, conn))
cmd.Parameters.Add("@param1", SqlDbType.VarChar, 50).Value = row.Cells["ColumnName2"].Value.ToString(); //set appropriate column name or its index
cmd.Parameters.Add("@param2", SqlDbType.Int).Value = int.Parse(row.Cells["ColumnName1"].Value.ToString()); //same here!! - this is some id (unique) column
if(conn.State != ConnectionState.Open)
break; //go out of the loop when 1st error occurs! - you can remove it
Use StreamReader to read line by line (rows), and a comma delimiter to split each line (columns).
Then you can for each row do insert or update into database, since you have all the values of a row.
Hope it helps.
//on main form:
Client c = new Client(this);
public void AddText(string text)
//on client class:
public Client(MainForm _mf)
this.mf = _mf;
string text = "";
//do some work ... and add value to text field;
//and pass to rtb on main form:
You only need the correct connection string to access to database.
And if SSMS (with database) is located on different pc, then you have to open a 1433 port (potr that is used to access to sql server by defalut) in the firewall.
You cannot remove items while inisde loops, nor for or foreach loop.
You will have to create a new list, where you will put numbers to delete, or indexes of them, and then add the duplicates inside out it. After this is done, you will have to do another loop through this new list and remove numbers from original list.