如何在程序中使用datagridview列中的数据进行输入....在C#中 [英] How to use data in a column of datagridview in the program for input....in C#

查看:76
本文介绍了如何在程序中使用datagridview列中的数据进行输入....在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已开始从事项目工作.已将e​​xcel数据导入到datagridview中.现在我需要将列中的数据用作输入.我的意思是我需要将列中的值分配为输入.任何人都可以帮助我使用该代码.以下代码在某种程度上是否正确.. C#的初学者,所以我对此不太了解...


MS Visual Studio 2010 C#中的程序

I''ve started working on a project.I''ve imported excel data onto a datagridview. Now I need to use the data in the column as input .I mean I need to assign the values in a column as input.Can anyone help me out with the code.Is the below code correct to some extent..I''m a beginner in C# so I do not have much idea about it...


Program in MS Visual studio 2010 C#

private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                netclass testNN = new netclass();


                double[][] input = new double[1000][];
                double[][] output = new double[1000][];

               input = datalist.Rows[e.rowindex].Cells["T,N"].Value;
               output = datalist.Rows[e.rowindex].Cells["Q"].Value;

                testNN.net(1,ref output,input);
                txt.Text=output[0].ToString();
            }




T,N是两个列名称
Q是我的输出列名称

我是否遗漏了任何程序集引用...




T,N are the two column names
Q is my output column name

Am I missing any assembly references...

推荐答案

您在某种程度上做错了.通常,它是通过绑定完成的.您将把excell加载为DataSet并将数据绑定到datagrid列.这是DataGrid的一个很好的概述,以及如何使用它: WPF DataGrid实用示例 [ ^ ].
您对以下章节感兴趣:绑定到数据集
You are doing it somewhat incorrectly. Usually it is done through binding. You would load your excell as DataSet and bind your data to datagrid columns. This is a good overview of DataGrid and what to do with it: WPF DataGrid Practical Examples[^].
You are interested in chapter: Binding to a DataSet


是否可以给我一个示例.我对C#不够了解.实际上我使用Matlab创建了一个神经网络.我想使用预先训练的网络,所以我将神经网络部署为.Net程序集.我只需要将excel中的列分配为输入和输出.可能的话出去吗?
Is it possible for you to give me an example..I do not have adequate knowledge in C#. Actually I used Matlab to create a neural network..I wanted to use the pre trained net so I deployed my neural net as a .Net assembly.I just need to assign the columns in excel as input and output..Can you help me out if possible?


这篇关于如何在程序中使用datagridview列中的数据进行输入....在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆