16,022,234 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 .NET 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 Robert S4r (Top 26 by date)
Robert S4r
7-Sep-22 0:00am
View
What if I want to copy from one cell to another on the same datagrid?
Robert S4r
16-Apr-21 1:22am
View
textboxes (XML) for second window.
< Label Content="{Binding sFirstName, Mode=OneWay }" />
< Label Content="{Binding sLastName, Mode=OneWay }" />
Robert S4r
15-Nov-20 10:52am
View
how? code....?
Robert S4r
15-Nov-20 10:51am
View
HOW? Code....?
Robert S4r
22-Mar-19 0:40am
View
This seems not to work for a countdown. It should count the remaining time to reach 10:30 second by second without showing milliseconds.
Robert S4r
7-Mar-19 14:48pm
View
Thanks for that extra advise! Appreciated!
Robert S4r
7-Mar-19 14:30pm
View
Solved successfully! Thanks a lot.
Robert S4r
7-Mar-19 12:53pm
View
I've renamed the app.config to SSM.config. "(from SSM.exe)".
now the NullReferenceException occurs on debug at line
var connection = ConfigurationManager.ConnectionStrings[ScMgP].ConnectionString;
Line modified
Robert S4r
7-Mar-19 12:46pm
View
Message box opens
Robert S4r
7-Mar-19 12:03pm
View
It indicates at line
connUN.ConnectionString = ConfigurationManager.ConnectionStrings["SSM.Properties.Settings.ScMgP"].ConnectionString;
Robert S4r
31-Jan-19 8:11am
View
But when I paste in any text editor, say MS office word, it pastes the data, meaning its copied in the clipboard.
Robert S4r
29-Jan-19 9:41am
View
What I mean is: just this code in VB was enough to accomplish the task, which is not the case for c# as it generates no response when converted.
Private Sub TSMItemUpdateL_Click(sender As Object, e As EventArgs) Handles TSMItemUpdateL.Click
LOAD_ALL()
End Sub
Sub LOAD_ALL()
Dim allrows1 As Integer = Me.DataGridView1.Rows.Count - 1
Dim allrows2 As Integer = Me.LowerDataGridView.Rows.Count - 1
If allrows1 > 0 Then
Dim i, j As Integer
For i = 0 To allrows1
For j = 0 To allrows2
If IsDBNull(DataGridView1.Item("Y_", i).Value) Then
ElseIf IsDBNull(DataGridView1.Item("T", i).Value) Then
ElseIf IsDBNull(DataGridView1.Item("C_", i).Value) Then
ElseIf IsDBNull(DataGridView1.Item("S_", i).Value) Then
ElseIf IsDBNull(DataGridView1.Item("s", i).Value) Then
ElseIf Not IsDBNull(DataGridView1.Item("Y_", i).Value) = Not IsDBNull(LowerDataGridView.Item("Y_", j).Value) And
Not IsDBNull(DataGridView1.Item("T", i).Value) = Not IsDBNull(LowerDataGridView.Item("T", j).Value) And
Not IsDBNull(DataGridView1.Item("C_", i).Value) = Not IsDBNull(LowerDataGridView.Item("C_", j).Value) And
Not IsDBNull(DataGridView1.Item("S_", i).Value) = Not IsDBNull(LowerDataGridView.Item("S_", j).Value) Then
If DataGridView1.Item("Y_", i).Value = LowerDataGridView.Item("Y_", j).Value Then
If DataGridView1.Item("T", i).Value = LowerDataGridView.Item("T", j).Value Then
If DataGridView1.Item("C_", i).Value = LowerDataGridView.Item("C_", j).Value Then
If DataGridView1.Item("S_", i).Value = LowerDataGridView.Item("S_", j).Value Then
If DataGridView1.Item("s", i).Value = "EN" Then
LowerDataGridView.Item("ENI", j).Value = DataGridView1.Item("INI_1", i).Value
ElseIf IsDBNull(LowerDataGridView.Item("S_8", j).Value) Then
ElseIf DataGridView1.Item("s", i).Value = "COM"
Then
If LowerDataGridView.Item("S_8", j).Value = DataGridView1.Item("s", i).Value Then
LowerDataGridView.Item("S8I", j).Value = DataGridView1.Item("INIT_1", i).Value
End If
End If
End If
End If
End If
End If
End If
Next
Next
End If
End Sub
I've tried plenty of converters both online and offline including (instant c#) and all convert well but no result when executed.
Sorry! I've just extructed it from the platform.
Hope you understand me. I know a percentage of c# but you can't know everything unless!
Robert S4r
29-Jan-19 8:59am
View
I hope you'll excuse me! As I stated earlier, I'm well conversant with VB.net where most of these codes are not needed. I'm trying to convert my project to c# - a requirement.
Thus some things may look too obvious but as you know c# and VB.net are extremely different.
And what I want to achieve seems unavailable on the internet coz I researched for two good weeks.
That's why I look for live examples to make conversions.
Thanks! Though I still have errors with the variables!!!! most probably positioning. The previous code is making wonders for current row but the part of multiple rows is failing everything yet it applys to 7+ sections.
Robert S4r
29-Jan-19 8:04am
View
valueFromForm2 ????????
Robert S4r
28-Jan-19 16:06pm
View
Maybe you haven't got my problem clearly!
How and where do I apply
>>>>>GetXY(int x, int y)<<<<<
in the above code???
Robert S4r
28-Jan-19 14:35pm
View
The problem is how to apply it to the get{return.....} property.
Robert S4r
28-Jan-19 12:34pm
View
I think x==i any row and y==2 ["third column"]
Actually. I've been using VB.net where most of these properties are not needed. But for some reasons, not long ago, I had to switch to c#
Robert S4r
28-Jan-19 11:26am
View
What seems obvious to one person may not necessarily be obvious to another. Fortunately you may take one of the first two reasons but there's plenty of reasons for consulting anyway. Kidding doesn't suit being a reason for people who have plenty of work to do!
So if you can, I request for the assistance, after all I wouldn't ask if I had the answers to everything.
Naturally, some people understand the complex but fail the obvious.
Honestly, nothing is moving on with the project coz of this. There's success for current row.cell property but failure for this case.
Thanks in advance.
Robert S4r
28-Jan-19 9:42am
View
Is there any reason of kidding? I'm here to seek for assistance.
Robert S4r
28-Jan-19 6:37am
View
Any example about it?
Robert S4r
28-Jan-19 5:48am
View
It was working fine for
currentRow.Cells[2].value.ToString();
Actually what I'm trying to achieve is:-
Look for any cell [2] value in form2 datagridview 2, compare it with any cell [2] value in form1 datagridview 1. If they correspond, then update cell[3] in datagridview 1. (When both forms are open)
Robert S4r
28-Jan-19 5:10am
View
This is an extract of what I've tried.(No results yet)
SOURCE DATAGRIDVIEW - FORM 2
--------------------------------------------------
public partial class Form2 : Form{
MySqlDataAdapter daStoreC = new MySqlDataAdapter(); DataSet dsStoreC = new DataSet();
public Form2()
{InitializeComponent();}
private void Form2_Load(object sender, EventArgs e)
{LOAD_STORE_CONSUMPTION();}
public DataTable MyDataTableProperty
{get { return dataGridView2.DataSource as DataTable; }set
{ dataGridView2.DataSource = value; }}
public event EventHandler DataAvailable;
protected virtual void OnDataAvailable(EventArgs e)
{EventHandler eh = DataAvailable;
if (eh != null)
{ eh(this, e); }}
private void button1_Click(object sender, EventArgs e)
{OnDataAvailable(null);}
private void LOAD_STORE_CONSUMPTION()
{Connectionss.S_DB();
string sqlStoreC = "SELECT * FROM store_stock";
try{
MySqlConnection ConnStoreC = new MySqlConnection(Connectionss.cnString);
ConnStoreC.Open();
MySqlDataAdapter daStoreC = new MySqlDataAdapter(sqlStoreC, ConnStoreC);
daStoreC.Fill(dsStoreC, "store_stock");
dataGridView2.DataSource = dsStoreC;
dataGridView2.DataMember = "store_stock";
ConnStoreC.Close();
ConnStoreC.Dispose();
}catch (Exception ex){MessageBox.Show(ex.Message);}
}}
//===========================
DESTINATION DGV - FORM 1
public partial class Form1 : Form{
public Form1() {InitializeComponent();}
private void Form1_Load(object sender, EventArgs e)
{LOAD_STORE_CONSUMPTION();}
void Form2_DataAvailable(object sender, EventArgs e)
{
Form2 form2 = sender as Form2;
if (form2 != null){
for (int i = 0; i <= dataGridView1.Rows.Count - 1; i++)
{dataGridView1.Rows[i].Cells[2].Value = form2.MyDataTableProperty;
}}
}
private void LOAD_STORE_CONSUMPTION()
{........................}
private void button1_Click(object sender, EventArgs e){
Form2 form = new Form2();
form.DataAvailable += new
EventHandler(Form2_DataAvailable);
form.Show();
}}
(BOTH FORMS ARE OPEN)
Robert S4r
28-Jan-19 4:41am
View
public DataTable dataTableF
Robert S4r
28-Jan-19 4:17am
View
I'm finding hard time packaging and setting the collection. DataTable seems to be the best option, but it throws an error
Cannot implicitly convert type object to system. Data.DataTable. an explicit conversion exists....
{
get {return datagridview1. DataSource;}
set {datagridview1.DataSource = value;}
}
Any help please!
Robert S4r
28-Jan-19 3:18am
View
For this case, its as if form 2 has no datagridview.
Robert S4r
27-Jan-19 17:41pm
View
Not yet. No idea on how to go about it.
Show More