dataset

R: How to Delete All Columns in a Dataframe Except A Specified Few By String [duplicate]

六眼飞鱼酱① 提交于 2019-12-13 12:52:23
问题 This question already has answers here : Extracting specific columns from a data frame (10 answers) Closed 3 years ago . I have a data frame in R that consists of around 400 variables (as columns), though I only need 25 of them. While I know how to delete specific columns, because of the impracticality of deleting 375 variables - is there any method in which I could delete all of them, except the specified 25 by using the variable's string name? Thanks. 回答1: Sample example: df <- data.frame(a

SAS merging with no common variable

纵然是瞬间 提交于 2019-12-13 10:25:32
问题 I need to merge two data sets that have no common variable, and only one variable apiece. One data set is about 200 lines of unique values and the other is 80,000 unique lines. I have tried the common merges, but cannot get what I'm looking for. The following is what I'm after: Set a variables: x y Set b variables: 1 2 3 Desired merged data sets result (2 columns): x 1 x 2 x 3 y 1 y 2 y 3 Thanks for any insight. 回答1: From my understanding of your question, it seems like you're trying to do a

SQL Like statement not working in Visual Basic

强颜欢笑 提交于 2019-12-13 09:49:28
问题 Dim strText As String = tbRefine.Text Dim sql As String = "SELECT user_name,forename,surname,game_cash,reg_group FROM tblGame WHERE user_name LIKE '" + strSearchText + "' & '*'" Dim dsRefine As New DataSet GetDataset(sql, "tblGame", dsRefine) MsgBox(dsRefine.Tables("tblGame").Rows(0).Item(2).ToString) This is not working, it crashes and says there is nothing in the dataset. I know the dataset function works as its worked successfully before. When i print out the sql statement into microsoft

OledbCommandBuilder Syntax error in insert into Statement c#?

妖精的绣舞 提交于 2019-12-13 07:49:04
问题 I know this question has been asked a hundred of times and I have looked at them all and don't know what's going wrong. This is the table in access: tbl_Slip SlipNo*, EmpID, ScaleID, Month-Year, RaiseBasic, OtherDed, Tax, Arrears, Notes, all the fields are integer type except for Month-Year and Notes which are text. Now the C# Part: This is the code I use. I tried to find out the error so made a button with harcoded values. (The oledbConnection works fine. I use it to display data on the form

RowNotInTableException when accessing second time

こ雲淡風輕ζ 提交于 2019-12-13 07:11:18
问题 I faced a problem when trying to access row again. I have TreeView component and in Tag property I put row from datatable: foreach (DataRow row in catalogDataSet.category) { if (row["parent"].ToString().Equals("0")) { TreeNode node = new TreeNode(); node.Text = row["name"].ToString(); node.Tag = row; string nodeId = row["id"].ToString(); if (this.HasChilds(nodeId)) { this.fillChilds(nodeId, node); } tree.Nodes.Add(node); } } Then I try to access row`s id: int locationId = int.Parse(((DataRow

Table Property broken after C# Typed DataSet Copy()

半腔热情 提交于 2019-12-13 04:32:42
问题 I've got a typed DataSet with multiple tables that I want copy, complete with data as well as schema. I can access the tables like so in my original: MyDataSetType dsMyFirstDataSet; MyDataTableType dtTable1; MyDataTableType dtTable2; dtTable1 = dsMyFirstDataSet.MeaningfulTableName1; dtTable2 = dsMyFirstDataSet.MeaningfulTableName2; When I do the following, I can no longer access the tables via the names in the new version but I can via the Tables collection. MyDataSetType dsMySecondDataSet;

C# DataSet XML loading and saving

谁说胖子不能爱 提交于 2019-12-13 04:23:52
问题 I've got XML that describes certain data (a template) that I want to be able to edit. I load XML into DataSet (see fig. 1 below), plug DataSet tables into DataGridView (switch between them using a separate comboBox), make changes and then save XML (simple DataSet.WriteXML directive). The XML I read looks very nice and humanly readable (see fig. 2 below), however, the written XML is nowhere near the original (see fig. 3 below). My goal is to allow editing of XML document and preserve it in the

save new record entered from Datagridview into the database

╄→гoц情女王★ 提交于 2019-12-13 04:04:03
问题 Am using a DataSet and a TableAdapter to populate a Datagridview. The Datagridview allows inserting new records at the bottom. Now when I enter values for the new record in the Datagridview, the record is not automatically saved back to the database. Which event do U need to handle or what code do I need to write to get the new record saved back to the databse. am using C#. 回答1: Are you calling the Update() method on the TableAdapter ? The following code comes from MSDN's discussion on the

Change column font style runtime in crystal report

烂漫一生 提交于 2019-12-13 03:59:16
问题 I have Crystal reports in my project that is designed using a data set (Having table with column name inLanguage1, inLanguage2). This data set is filled with data from one of the tables from a database, each table have two columns that store names in two different languages. Eg: Table 1 has name in Hindi and English. Table 2 has name in English and Hindi. Table 3 has name in Kannada and Hindi. While I store names in these tables, using my frontend (C#), I have set the corresponding font type