field

Sql server dynamic pivot with dynamic fields type

落花浮王杯 提交于 2019-12-23 05:26:02
问题 I need to build a dynamic pivot table on Sql Server 2005 and I found several excellent answers on how to do it, but I have an extra requirement to implement: dynamic field type . This is my data structure CREATE TABLE [dbo].[MyData]( [Key] [char](12) NOT NULL, [AttributeName] [char](3) NOT NULL, [AttributeValue] [char](40) NOT NULL) This is the definition of types. CREATE TABLE [dbo].[Attributes]( [AttributeName] [char](3) NOT NULL, [CastTo] [char](10) NOT NULL, [Size] int NULL, [Precision]

Fill out custom field with used coupon code WooCommerce

不羁岁月 提交于 2019-12-23 05:18:07
问题 Right now I'm working with a mailchimp plugin that needs a custom field for validating/segmenting. For this segment I want to check what kind of coupon is used. So I scavenged the following code that should fill my custom field with the used coupons: add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' ); function my_custom_checkout_field_update_order_meta( $order_id ) { if ( empty( $_POST['my_field_name'] ) ) { $coupons = $order->get_used_coupons

Error: A field initializer cannot reference the non-static field, method, or property

二次信任 提交于 2019-12-23 04:39:17
问题 I can't find a solution for the following: Code: class ApiData { SqlCeConnection conn = new SqlCeConnection(@"Data Source=C:\Users\Peter\Documents \db.sdf;"); SqlCeCommand cmd = null; SqlCeDataReader rdr = null; public string code() { conn.Open(); cmd = conn.CreateCommand(); cmd.CommandText ="SELECT code FROM Charakter WHERE id=1"; rdr = cmd.ExecuteReader(); rdr.Read(); string selected = rdr.GetString(0); conn.Close(); return (selected); } class Data{ ApiData g= new ApiData(); string vode = *

SharePoint 2010: Set field value from query triggered by choice box selection

别来无恙 提交于 2019-12-23 04:30:56
问题 How do you link a form field to a choicebox selection so that the field's value is set by the information referenced by the ID of the choicebox selection? I have a choicebox in a custom list form which is bound to a "Client" list which contains client names, IDs, reference numbers, addresses, etc. The choicebox displays the client name and has the selected value set to ID. I would then like to query the Client list by the selected ID to populate form fields with Client Name, Client Address,

Silverlight 3 Dataform - how to add fieds at runtime

故事扮演 提交于 2019-12-23 04:30:35
问题 I am creating a DataForm from dynamic data (so I can't create the columns in the xaml), I currently create columns for my DataGrid (I have not worked out how I can create a button + event in a colomn yet) foreach (var item in headings.Entities) { theDataGrid.Columns.Add( new DataGridTextColumn { Header = item.Label, Binding = new Binding(item.LocalName) }); } I cannot see any methods to add fields to a DataForm at runtime, however... 回答1: You'd be better off not creating your datagrid columns

SharePoint 2010: Set field value from query triggered by choice box selection

夙愿已清 提交于 2019-12-23 04:30:32
问题 How do you link a form field to a choicebox selection so that the field's value is set by the information referenced by the ID of the choicebox selection? I have a choicebox in a custom list form which is bound to a "Client" list which contains client names, IDs, reference numbers, addresses, etc. The choicebox displays the client name and has the selected value set to ID. I would then like to query the Client list by the selected ID to populate form fields with Client Name, Client Address,

AWK Multiple Field Separators and Variables

霸气de小男生 提交于 2019-12-23 03:47:25
问题 I am trying to perform calculations in awk using fields whose numbers are passed in from the shell, as well as the last four fields e.g. I call my shell script like this ./myProgram myFile.txt 1 2 3 4 Then within my shell script I want to use awk to refer to fields in a text file like this, specifically the last four fields. $(NF-3) - $(NF) 0000000022:trevor:736:1,2:3,4 0000000223:john:73:5,6:7,8 0000002224:eliza:54:9,8:7,6 0000022225:paul:22:5,4:3,2 0000222226:chris:0:1,2:3,4 So I can go

add result of image.plot layer on geographic map (bing map)

无人久伴 提交于 2019-12-23 03:19:24
问题 I have a 2D footprint result for an eddy-covariance system on a 1100*1100 square meter, with the domain of domain = c(-100,1000,-100, 1000) the cell size of the domain (each grid) is 2 meters with the origin (0,0) accordingly on this location: Lon = -97.191391 #longtitude Lat = 36.055935 #latitude An example data (9.01 Mb) is attached here. FFP.rds then I can plot a Bing map on my site as this: library(OpenStreetMap) library(rgdal) map <- openmap(c(36.05778,-97.19250), c(36.05444,-97.18861)

django simple approach to multi-field search

北战南征 提交于 2019-12-23 03:15:34
问题 I have a simple address book app that I want to make searchable. The model would look something like: class Address(models.Model): address1 = models.CharField("Address Line 1", max_length=128) address2 = models.CharField("Address Line 2", max_length=128) city = models.CharField("City", max_length=128) state = models.CharField("State", max_length=24) zipCode = models.CharField("Zip Code", max_length=24) def __unicode__(self): return "%s %s, %s, %s, %s" % (self.address1, self.address2, self

Sorting by unique values of multiple fields in UNIX shell script

本秂侑毒 提交于 2019-12-23 02:36:58
问题 I am new to unix and would like to be able to do the following but am unsure how. Take a text file with lines like: TR=P567;dir=o;day=su;TI=12:10;stn=westborough;Line=worcester TR=P567;dir=o;day=su;TI=12:10;stn=westborough;Line=lowell TR=P567;dir=o;day=su;TI=12:10;stn=westborough;Line=worcester TR=P234;dir=o;day=su;TI=12:10;stn=westborough;Line=lowell TR=P234;dir=o;day=su;TI=12:10;stn=westborough;Line=lowell TR=P234;dir=o;day=su;TI=12:10;stn=westborough;Line=worcester And output this: TR=P567