Using promises for mulitple queries to Google sheets - asynchronous
I'm a beginner coder, and would like some help with speeding up my Google sheet queries. I have looked around a lot and cannot find a solution. I'm trying to run 25 queries to a Google sheet quickly, and this is how I'm trying it:
Run a query to a Google sheet.
Push the result to an array.
Run a different query.
Push the result to the same array.
Run the next query... x 25.
Draw a table of the final result.
The problem is that if I run the quires one by one they take 25 seconds to complete. If I run the quires in a for loop the results come back in 2 second, but asynchronously, and the data is all out of wack. Perhaps, I should use a promise, or something else. Please can you help.
Here is the code with the slow version:
var resultData;
var allData = [];
var i = 0;
function startQuery() {
i = 0;
allData.length = 0;
runOnecode();
}
function runOnecode() {
var str = "";
str += $(".google-visualization-controls-rangefilter-thumblabel").text();
var until = str.substring(10);
var from = str.substring(0,10);
var center = $("#centerSelect option:selected").text();
var query = [
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND G =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND H =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND I =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND J =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND K =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND N =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND O =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND P =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Q =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND R =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND S =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND T =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND U =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND V =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND W =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND X =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Y =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Z =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AA =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AB =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AC =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AD =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AE =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AF =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AG =\"No\" ")
];
getData(query[i]);
}
</script>
<script>
function getData(incomingQuery) {
// Prepare the query
var queryString = encodeURIComponent(incomingQuery);
var query = new google.visualization.Query(
//Collect the data from this spreadsheet
'MySpreadSheet URL' + queryString);
query.send(handleSampleDataQueryResponse);
//Handle any errors from the Google server
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
// get look into the resulting data and find the detail.
var datas = response.getDataTable();
if (datas.Gf.length === 0) {
resultData = 0;
} else resultData = datas.Gf[0].c[0].v;
allData.push(resultData);
// console.log(allData);
if (i < 25) {
runOnecode();
} else {
drawTable();
}
i++;
}
}
</script>
Here is the fast version that returns the results asynchronously:
<script>
function runOnecode() {
var str = "";
str += $(".google-visualization-controls-rangefilter-thumblabel").text();
var until = str.substring(10);
var from = str.substring(0,10);
var center = $("#centerSelect option:selected").text();
var query = [
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND G =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND H =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND I =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND J =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND K =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND N =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND O =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND P =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Q =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND R =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND S =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND T =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND U =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND V =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND W =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND X =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Y =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND Z =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AA =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AB =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AC =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AD =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AE =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AF =\"No\" "),
("SELECT COUNT(A) WHERE C =\"" + center + "\" AND todate(A) >=date \'" + from + "\' AND todate(A) <=date \'" + until + "\' AND AG =\"No\" ")
];
for(var i=0; i<25; i++){
getData(query[i]);
// When all are done I will draw the table.
}
}
</script>
<script>
function getData(incomingQuery) {
// Prepare the query
var queryString = encodeURIComponent(incomingQuery);
var query = new google.visualization.Query(
//Collect the data from this spreadsheet
'MySpreadSheet URL' + queryString);
query.send(handleSampleDataQueryResponse);
//Handle any errors from the Google server
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
// get look into the resulting data and find the detail.
var datas = response.getDataTable();
console.log(datas);
if (datas.Gf.length === 0) {
resultData = 0;
} else resultData = datas.Gf[0].c[0].v;
allData.push(resultData);
console.log(allData);
}
}
</script>
Using promises, you can do this
function runOnecode() {
var str = "";
str += $(".google-visualization-controls-rangefilter-thumblabel").text();
var until = str.substring(10);
var from = str.substring(0,10);
var center = $("#centerSelect option:selected").text();
var query = [
// your query data, removed for brevity ...
];
Promise.all(query.map(getData))
.then(function(results) {
// results is an array of results in the same order as query
})
.catch(function(err) {
// err is FIRST error - no other information about success/faill of other queries will be available
});
}
function getData(incomingQuery) {
return new Promise(function(fulfill, reject) {
// Prepare the query
var queryString = encodeURIComponent(incomingQuery);
var query = new google.visualization.Query(
//Collect the data from this spreadsheet
'MySpreadSheet URL' + queryString);
query.send(handleSampleDataQueryResponse);
//Handle any errors from the Google server
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
throw('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
}
// get look into the resulting data and find the detail.
var datas = response.getDataTable();
console.log(datas);
if (datas.Gf.length === 0) {
resultData = 0;
} else {
resultData = datas.Gf[0].c[0].v;
}
fulfill(resultData);
}
});
}
if you need to get the state of all queries success/failure, you could use something like Q promises which has a allSettled method (instead of Promise.all), which returns the result of all promises regardless of success/failure
Or, here's one I rolled myself
Promise.allSettled = function(arr) {
return Promise.all([].map.call(arr,
function(v) {
return Promise.resolve(v).then(
function fulfilled (x) { return {fulfilled: true, value: x}; },
function rejected (e) { return {fulfilled: false, value: e}; }
);
})
);
};
runOnecode would then look like
function runOnecode() {
var str = "";
str += $(".google-visualization-controls-rangefilter-thumblabel").text();
var until = str.substring(10);
var from = str.substring(0,10);
var center = $("#centerSelect option:selected").text();
var query = [
// your query data, removed for brevity ...
];
Promise.allSettled(query.map(getData))
.then(function(results) {
// results is an array of results in the same order as query
results.forEach(function(result) {
if (result.fulfilled) {
// successful
console.log(result.value);
}
else {
// unsuccessful
console.log(result.value); // will show the thrown error
}
});
});
}
Related
When I am trying to send image from system it is not showing in mail body
This is my code: { string To = Server.HtmlEncode(Request.Cookies["userInfo"]["Email"]).ToString(); string name = Server.HtmlEncode(Request.Cookies["userInfo"]["Name"]).ToString(); string Subject = "IQC Non-leather Status"; string email_body = "Item has been checked by QC with the following details.. "; string sImage = System.Web.HttpContext.Current.Server.MapPath("~/Content/Uploads/image.jpg"); DataTable dtqc = new ifs_ShipmentInfo_DAL().qc_po_info(site, IQC_STORE_SL); email_body += #"<table>"; if (dtqc.Rows.Count > 0) This is the mail body: { DataRow dr = dtqc.Rows[0]; email_body += "<tr><td>Supplier Name</td><td>:</td><td>" + Convert.ToString(dr["SUPPLIER_NAME"]) + "</td></tr>"; email_body += "<tr><td>PO NO</td><td>:</td><td>" + Convert.ToString(dr["PO_NO"]) + "</td></tr>"; email_body += "<tr><td>Invoice No</td><td>:</td><td>" + Convert.ToString(dr["COMMERCIAL_INV_NO"]) + "</td></tr>"; email_body += "<tr><td>Invoice recvd date</td><td>:</td><td>" + Convert.ToString(dr["DATE_OF_RECEIVING"]) + "</td></tr>"; email_body += "<tr><td>Part No</td><td>:</td><td>" + Convert.ToString(dr["PART_NO"]) + "</td></tr>"; email_body += "<tr><td>Part Description</td><td>:</td><td>" + Convert.ToString(dr["PART_DESC"]) + "</td></tr>"; email_body += "<tr><td>Invoice Qnty</td><td>:</td><td>" + Convert.ToString(dr["INVOICE_QTY"]) + "</td></tr>"; email_body += "<tr><td>Final Result</td><td>:</td><td>" + INSPECTION_RESULT + "</td></tr>"; email_body += "<tr><td>Reason</td><td>:</td><td>" + insRemarks + "</td></tr>" + "<tr><td>Inspected Qnty</td><td>:</td><td>" + INSPECTION_QTY + "</td></tr>" + "<tr><td>Accepted Qnty</td><td>:</td><td>" + ACCEPTED_QTY + "</td></tr>" + "<tr><td>Rejected Qnty</td><td>:</td><td>" + REJECTED_QTY + "</td></tr>" + "<tr><td>Fully Rejected Qnty</td><td>:</td><td>" + FINAL_REJECTED_QTY + "</td></tr>" + "<tr><td>Inspected By</td><td>:</td><td>" + INSPECTED_BY + "</td></tr>" Trying to send image like this: + "<tr><td>Defective Picture</td><td>:</td><td><img src='" + sImage + "'width='100'height='100'alt='img'style='margin:20px 0px 0px 20px'/></td></tr>"; } email_body += "</table>";
Problem with Lavaan not computing standard errors, the information matrix could not be converted
I am trying to run a CFA in R. The code looks like this: item.model1 <- ' Reflective =~ IES_EFPR_3 + IES_EFPR_10 + IES_EFPR_16 + IES_EFPR_17 + IES_EFPR_23 + IES_EFPR_24 + IES_EFPR_25 + IES_EFPR_26 + IES_RHSC_11 + IES_RHSC_12 + IES_RHSC_13 + IES_RHSC_35 + IES_RHSC_36 + IES_RHSC_37 + IES_BFCC_31 + IES_BFCC_32 + IES_BFCC_33 + SREBQ_A + SREBQ_B + SREBQ_C + SREBQ_D + SREBQ_E Reactive =~ BES_1 + BES_2 + BES_3 + BES_4 + BES_5 + BES_6 + BES_7 + BES_8 + BES_9 + BES_10 + BES_11 + BES_12 + BES_13 + BES_14 + BES_15 + BES_16 + PFS_1 + PFS_2 + PFS_3 + PFS_4 + PFS_5 + PFS_6 + PFS_7 + PFS_8 + PFS_9 + PFS_10 + PFS_11 + PFS_12 + PFS_13 + PFS_14 + PFS_15 + AEBQ_153 + AEBQ_155 + AEBQ_154 + AEBQ_156 + AEBQ_157 + AEBQ_146 + AEBQ_145 + AEBQ_144 + AEBQ_147 + AEBQ_148 + AEBQ_149 + AEBQ_150 + AEBQ_151 + AEBQ_152 + DEBQ_11 + DEBQ_12 + DEBQ_13 + DEBQ_14 + DEBQ_15 + DEBQ_16 + DEBQ_17 + DEBQ_18 + DEBQ_19 + DEBQ_20 + TFEQ_D_16 + TFEQ_D_25 + TFEQ_D_31 + TFEQ_D_1 + TFEQ_D_2 + TFEQ_D_7 + TFEQ_D_9 + TFEQ_D_11 + TFEQ_D_13 + TFEQ_D_15 + TFEQ_D_20 + TFEQ_D_27 + TFEQ_D_36 + TFEQ_D_45 + TFEQ_D_49 + TFEQ_D_51 + TFEQ_H_3 + TFEQ_H_5 + TFEQ_H_8 + TFEQ_H_12 + TFEQ_H_17 + TFEQ_H_19 + TFEQ_H_22 + TFEQ_H_24 + TFEQ_H_26 + TFEQ_H_29 + TFEQ_H_34 + TFEQ_H_39 + TFEQ_H_41 + TFEQ_H_47 + PNEES_1 + PNEES_2 + PNEES_4 + PNEES_6 + PNEES_7 + PNEES_8 + PNEES_11 + PNEES_12 + PNEES_13 + PNEES_15 + PNEES_16 + PNEES_18 IES.EFPR =~ IES_EFPR_3 + IES_EFPR_10 + IES_EFPR_16 + IES_EFPR_17 + IES_EFPR_23 + IES_EFPR_24 + IES_EFPR_25 + IES_EFPR_26 IES.RHSC =~ IES_RHSC_11 + IES_RHSC_12 + IES_RHSC_13 + IES_RHSC_35 + IES_RHSC_36 + IES_RHSC_37 IES.BFCC =~ IES_BFCC_31 + IES_BFCC_32 + IES_BFCC_33 SREBQ. =~ SREBQ_A + SREBQ_B + SREBQ_C + SREBQ_D + SREBQ_E BES. =~ BES_1 + BES_2 + BES_3 + BES_4 + BES_5 + BES_6 + BES_7 + BES_8 + BES_9 + BES_10 + BES_11 + BES_12 + BES_13 + BES_14 + BES_15 + BES_16 PFS. =~ PFS_1 + PFS_2 + PFS_3 + PFS_4 + PFS_5 + PFS_6 + PFS_7 + PFS_8 + PFS_9 + PFS_10 + PFS_11 + PFS_12 + PFS_13 + PFS_14 + PFS_15 AEBQ.EOE =~ AEBQ_153 + AEBQ_155 + AEBQ_154 + AEBQ_156 + AEBQ_157 AEBQ.H =~ AEBQ_146 + AEBQ_145 + AEBQ_144 + AEBQ_147 + AEBQ_148 AEBQ.FR =~ AEBQ_149 + AEBQ_150 + AEBQ_151 + AEBQ_152 DEBQ.EX =~ DEBQ_11 + DEBQ_12 + DEBQ_13 + DEBQ_14 + DEBQ_15 + DEBQ_16 + DEBQ_17 + DEBQ_18 + DEBQ_19 + DEBQ_20 TFEQ.D =~ TFEQ_D_16 + TFEQ_D_25 + TFEQ_D_31 + TFEQ_D_1 + TFEQ_D_2 + TFEQ_D_7 + TFEQ_D_9 + TFEQ_D_11 + TFEQ_D_13 + TFEQ_D_15 + TFEQ_D_20 + TFEQ_D_27 + TFEQ_D_36 + TFEQ_D_45 + TFEQ_D_49 + TFEQ_D_51 TFEQ.H =~ TFEQ_H_3 + TFEQ_H_5 + TFEQ_H_8 + TFEQ_H_12 + TFEQ_H_17 + TFEQ_H_19 + TFEQ_H_22 + TFEQ_H_24 + TFEQ_H_26 + TFEQ_H_29 + TFEQ_H_34 + TFEQ_H_39 + TFEQ_H_41 + TFEQ_H_47 PNEES.N =~ PNEES_1 + PNEES_2 + PNEES_4 + PNEES_6 + PNEES_7 + PNEES_8 + PNEES_11 + PNEES_12 + PNEES_13 + PNEES_15 + PNEES_16 + PNEES_18 ' ### calculate model item.cfa.1 <- cfa(item.model1, data = item.dat, missing="pairwise", std.lv = TRUE, ordered =ALL) summary(item.cfa.1, fit.measures=TRUE, standardized=TRUE) When I run the code I get this error message: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, : lavaan WARNING: Could not compute standard errors! The information matrix could not be inverted. This may be a symptom that the model is not identified. I understand this could be because my model is not identified. However, when I check the df's it says there are 7021 df's. I am also not sure how to test my model to see if it under identified. Any advice would be very helpful.
Correct way to pass SqlParameter into SQL native query Asp Core web api
This is my String tempStr = "'''" + shain.searchAffiliation + "'''"; If I use String affSetStr = " SET #Affiliation = " + tempStr + " ;"; " Then pass to queryStr, the query will work without any problem. But this query will have sql injection attack. Now I pass tempStr variable to SqlParameter shainParameterSearchName = new SqlParameter("#searchAffiliation", tempStr); Then my query is return an empty list. What is the right way to pass tempStr to SqlParameter("#searchAffiliation", tempStr);? String tempStr = "'''" + shain.searchAffiliation + "'''"; SqlParameter shainParameterSearchName = new SqlParameter("#searchAffiliation", tempStr); shainParamsObj.Add(shainParameterSearchName); affSetStr = " SET #Affiliation = " + tempStr + " ;"; String queryStr = " " + "DECLARE #Name VARCHAR(50);" + "DECLARE #Affiliation VARCHAR(50); " + searchSetStr + affSetStr + "DECLARE #AgeStr INT;" + "DECLARE #AgeEd INT;" + "SET #AgeStr = #ageStart;" + "SET #AgeEd = #ageEnd; " + "DECLARE #fromIdx INT;" + "DECLARE #toIdx INT; " + "SET #fromIdx = #fromIndex; " + "SET #toIdx = #toIndex; " + "declare #sqll nvarchar(max) = '" + "SELECT" + " * " + " FROM" + " ( SELECT" + " ROW_NUMBER() OVER ( " + " ORDER BY " + orderStr + " ) AS RowNum, " + " S1.INCODE id , " + " DATEDIFF(DAY,S1.KOM005,GETDATE()) age, " + " CASE " + " WHEN DATEDIFF(DAY,S1.KOM035,S1.KOM027) < 0 " + " THEN DATEDIFF(DAY, S1.KOM035, GETDATE()) " + " ELSE DATEDIFF(DAY, S1.KOM035, S1.KOM027) " + " END AS lenghtOfService , " + " S1.KOM001 employeeCode , " + " S1.KOM005 dbo , " + " ISNULL(S1.KOM004,0) gender , " + " S1.KOM035 enterDate , " + " S1.KOM027 retireDate , " + " S2.KOM506 postion , " + " S2.KOM002 name , " + " S2.KOM003 furigana , " + " S2.KOM021 phone , " + " S2.KOM527 email, " + " S2.KOM512 postCode , " + " S2.KOM509 contactPerson ," + " S2.KOM513 address1 , " + " S2.KOM514 address2," + " S2.KOM515 tel1, " + " S2.KOM507 affiliation, " + " S2.KOM516 tel2, " + " ISNULL( '+ dbo.CheckIfColumnExist( 'dbo','RIREKI13','R.KOM001', 'CAST(0 as FLOAT)' ) + ' ,0) CP , " + " ISNULL( '+ dbo.CheckIfColumnExist( 'dbo','RIREKI13','R.KOM002', 'CAST(0 as FLOAT)' ) + ' ,0) NP, " + " ISNULL( '+ dbo.CheckIfColumnExist( 'dbo','RIREKI13','R.KOM003', 'CAST(0 as FLOAT)' ) + ' ,0) A, " + " ISNULL( '+ dbo.CheckIfColumnExist( 'dbo','RIREKI13','R.KOM004', 'CAST(0 as FLOAT)' ) + ' ,0) FC, " + " ISNULL( '+ dbo.CheckIfColumnExist( 'dbo','RIREKI13','R.KOM005', 'CAST(0 as FLOAT)' ) + ' ,0) AC " + " FROM " + " dbo.SHAIN1 as S1 " + " join " + " dbo.SHAIN2 as S2 " + " on S1.INCODE = S2.SHAIN " + " FULL join " + " RIREKI13 as R " + " on R.INCODE = S2.SHAIN " + ifCase + " ) AS RowConstrainedResult " + " " + " WHERE RowNum >= " + " ' + CONVERT(VARCHAR(12), #fromIdx) + ' " + " AND RowNum < " + " ' + CONVERT(VARCHAR(12), #toIdx) + ' " + " ORDER BY RowNum " + "'; " + " exec sp_executesql #sqll "; List<Shain> shainList = await _context.Shain.FromSql(queryStr,shainParamsObj.ToArray()).ToListAsync();
Paste not working for long strings? [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 5 years ago. Improve this question I cannot for the life of me figure out why paste with collapse="\n" won't work for me, for just this line (it works in other parts of the code). Perhaps a character limit with the paste function? (I have trimmed leading and lagging white space) Below you will notice that paste does not in fact insert \n between the two long strings: > MM [1] "F1_all =~ target\nF2_all =~ target\nF3_all =~ target\nF4_all =~ target\nF5_all =~ target\nF6_all =~ target" > regsflat [1] "F1_all ~ 1*F1_0351 + 1*F1_0354 + 1*F1_0414 + 1*F1_0415 + 1*F1_0420 + 1*F1_0430 + 1*F1_0464 + 1*F1_0484 + 1*F1_0488 + 1*F1_0496 + 1*F1_0508 + 1*F1_0517 + 1*F1_0527 + 1*F1_0592 + 1*F1_0593 + 1*F1_0596 + 1*F1_0609 + 1*F1_0640 + 1*F1_0646 + 1*F1_0647 + 1*F1_0683 + 1*F1_0686 + 1*F1_0691 + 1*F1_0696 + 1*F1_0713 + 1*F1_0715 + 1*F1_0717 + 1*F1_0757 + 1*F1_0759 + 1*F1_0764 + 1*F1_0765 + 1*F1_0771 + 1*F1_0772 + 1*F1_0775 + 1*F1_0776 + 1*F1_0778 + 1*F1_0781 + 1*F1_0793 + 1*F1_0796 + 1*F1_0797 + 1*F1_0799 + 1*F1_0842 + 1*F1_0843 + 1*F1_0845 + 1*F1_0865 + 1*F1_0879 + 1*F1_0895 + 1*F1_0936 + 1*F1_1544 + 1*F1_1545 + 1*F1_1802 + 1*F1_1803 + 1*F1_1804 + 1*F1_1805 + 1*F1_1806 + 1*F1_1807 + 1*F1_1809 + 1*F1_1815 + 1*F1_2261 + 1*F1_2262 + 1*F1_2353 + 1*F1_2354 + 1*F1_2435 + 1*F1_BBRM1WA + 1*F1_BBRM2WA + 1*F1_BUSINESSBANKWA + 1*F1_CBWACENTRAL + 1*F1_CBWASOUTH + 1*F1_R&R-WESTCOAST\nF2_all ~ 1*F2_0351 + 1*F2_0354 + 1*F2_0414 + 1*F2_0415 + 1*F2_0420 + 1*F2_0430 + 1*F2_0464 + 1*F2_0484 + 1*F2_0488 + 1*F2_0496 + 1*F2_0508 + 1*F2_0517 + 1*F2_0527 + 1*F2_0592 + 1*F2_0593 + 1*F2_0596 + 1*F2_0609 + 1*F2_0640 + 1*F2_0646 + 1*F2_0647 + 1*F2_0683 + 1*F2_0686 + 1*F2_0691 + 1*F2_0696 + 1*F2_0713 + 1*F2_0715 + 1*F2_0717 + 1*F2_0757 + 1*F2_0759 + 1*F2_0764 + 1*F2_0765 + 1*F2_0771 + 1*F2_0772 + 1*F2_0775 + 1*F2_0776 + 1*F2_0778 + 1*F2_0781 + 1*F2_0793 + 1*F2_0796 + 1*F2_0797 + 1*F2_0799 + 1*F2_0842 + 1*F2_0843 + 1*F2_0845 + 1*F2_0865 + 1*F2_0879 + 1*F2_0895 + 1*F2_0936 + 1*F2_1544 + 1*F2_1545 + 1*F2_1802 + 1*F2_1803 + 1*F2_1804 + 1*F2_1805 + 1*F2_1806 + 1*F2_1807 + 1*F2_1809 + 1*F2_1815 + 1*F2_2261 + 1*F2_2262 + 1*F2_2353 + 1*F2_2354 + 1*F2_2435 + 1*F2_BBRM1WA + 1*F2_BBRM2WA + 1*F2_BUSINESSBANKWA + 1*F2_CBWACENTRAL + 1*F2_CBWASOUTH + 1*F2_R&R-WESTCOAST\nF3_all ~ 1*F3_0351 + 1*F3_0354 + 1*F3_0414 + 1*F3_0415 + 1*F3_0420 + 1*F3_0430 + 1*F3_0464 + 1*F3_0484 + 1*F3_0488 + 1*F3_0496 + 1*F3_0508 + 1*F3_0517 + 1*F3_0527 + 1*F3_0592 + 1*F3_0593 + 1*F3_0596 + 1*F3_0609 + 1*F3_0640 + 1*F3_0646 + 1*F3_0647 + 1*F3_0683 + 1*F3_0686 + 1*F3_0691 + 1*F3_0696 + 1*F3_0713 + 1*F3_0715 + 1*F3_0717 + 1*F3_0757 + 1*F3_0759 + 1*F3_0764 + 1*F3_0765 + 1*F3_0771 + 1*F3_0772 + 1*F3_0775 + 1*F3_0776 + 1*F3_0778 + 1*F3_0781 + 1*F3_0793 + 1*F3_0796 + 1*F3_0797 + 1*F3_0799 + 1*F3_0842 + 1*F3_0843 + 1*F3_0845 + 1*F3_0865 + 1*F3_0879 + 1*F3_0895 + 1*F3_0936 + 1*F3_1544 + 1*F3_1545 + 1*F3_1802 + 1*F3_1803 + 1*F3_1804 + 1*F3_1805 + 1*F3_1806 + 1*F3_1807 + 1*F3_1809 + 1*F3_1815 + 1*F3_2261 + 1*F3_2262 + 1*F3_2353 + 1*F3_2354 + 1*F3_2435 + 1*F3_BBRM1WA + 1*F3_BBRM2WA + 1*F3_BUSINESSBANKWA + 1*F3_CBWACENTRAL + 1*F3_CBWASOUTH + 1*F3_R&R-WESTCOAST\nF4_all ~ 1*F4_0351 + 1*F4_0354 + 1*F4_0414 + 1*F4_0415 + 1*F4_0420 + 1*F4_0430 + 1*F4_0464 + 1*F4_0484 + 1*F4_0488 + 1*F4_0496 + 1*F4_0508 + 1*F4_0517 + 1*F4_0527 + 1*F4_0592 + 1*F4_0593 + 1*F4_0596 + 1*F4_0609 + 1*F4_0640 + 1*F4_0646 + 1*F4_0647 + 1*F4_0683 + 1*F4_0686 + 1*F4_0691 + 1*F4_0696 + 1*F4_0713 + 1*F4_0715 + 1*F4_0717 + 1*F4_0757 + 1*F4_0759 + 1*F4_0764 + 1*F4_0765 + 1*F4_0771 + 1*F4_0772 + 1*F4_0775 + 1*F4_0776 + 1*F4_0778 + 1*F4_0781 + 1*F4_0793 + 1*F4_0796 + 1*F4_0797 + 1*F4_0799 + 1*F4_0842 + 1*F4_0843 + 1*F4_0845 + 1*F4_0865 + 1*F4_0879 + 1*F4_0895 + 1*F4_0936 + 1*F4_1544 + 1*F4_1545 + 1*F4_1802 + 1*F4_1803 + 1*F4_1804 + 1*F4_1805 + 1*F4_1806 + 1*F4_1807 + 1*F4_1809 + 1*F4_1815 + 1*F4_2261 + 1*F4_2262 + 1*F4_2353 + 1*F4_2354 + 1*F4_2435 + 1*F4_BBRM1WA + 1*F4_BBRM2WA + 1*F4_BUSINESSBANKWA + 1*F4_CBWACENTRAL + 1*F4_CBWASOUTH + 1*F4_R&R-WESTCOAST\nF5_all ~ 1*F5_0351 + 1*F5_0354 + 1*F5_0414 + 1*F5_0415 + 1*F5_0420 + 1*F5_0430 + 1*F5_0464 + 1*F5_0484 + 1*F5_0488 + 1*F5_0496 + 1*F5_0508 + 1*F5_0517 + 1*F5_0527 + 1*F5_0592 + 1*F5_0593 + 1*F5_0596 + 1*F5_0609 + 1*F5_0640 + 1*F5_0646 + 1*F5_0647 + 1*F5_0683 + 1*F5_0686 + 1*F5_0691 + 1*F5_0696 + 1*F5_0713 + 1*F5_0715 + 1*F5_0717 + 1*F5_0757 + 1*F5_0759 + 1*F5_0764 + 1*F5_0765 + 1*F5_0771 + 1*F5_0772 + 1*F5_0775 + 1*F5_0776 + 1*F5_0778 + 1*F5_0781 + 1*F5_0793 + 1*F5_0796 + 1*F5_0797 + 1*F5_0799 + 1*F5_0842 + 1*F5_0843 + 1*F5_0845 + 1*F5_0865 + 1*F5_0879 + 1*F5_0895 + 1*F5_0936 + 1*F5_1544 + 1*F5_1545 + 1*F5_1802 + 1*F5_1803 + 1*F5_1804 + 1*F5_1805 + 1*F5_1806 + 1*F5_1807 + 1*F5_1809 + 1*F5_1815 + 1*F5_2261 + 1*F5_2262 + 1*F5_2353 + 1*F5_2354 + 1*F5_2435 + 1*F5_BBRM1WA + 1*F5_BBRM2WA + 1*F5_BUSINESSBANKWA + 1*F5_CBWACENTRAL + 1*F5_CBWASOUTH + 1*F5_R&R-WESTCOAST\nF6_all ~ 1*F6_0351 + 1*F6_0354 + 1*F6_0414 + 1*F6_0415 + 1*F6_0420 + 1*F6_0430 + 1*F6_0464 + 1*F6_0484 + 1*F6_0488 + 1*F6_0496 + 1*F6_0508 + 1*F6_0517 + 1*F6_0527 + 1*F6_0592 + 1*F6_0593 + 1*F6_0596 + 1*F6_0609 + 1*F6_0640 + 1*F6_0646 + 1*F6_0647 + 1*F6_0683 + 1*F6_0686 + 1*F6_0691 + 1*F6_0696 + 1*F6_0713 + 1*F6_0715 + 1*F6_0717 + 1*F6_0757 + 1*F6_0759 + 1*F6_0764 + 1*F6_0765 + 1*F6_0771 + 1*F6_0772 + 1*F6_0775 + 1*F6_0776 + 1*F6_0778 + 1*F6_0781 + 1*F6_0793 + 1*F6_0796 + 1*F6_0797 + 1*F6_0799 + 1*F6_0842 + 1*F6_0843 + 1*F6_0845 + 1*F6_0865 + 1*F6_0879 + 1*F6_0895 + 1*F6_0936 + 1*F6_1544 + 1*F6_1545 + 1*F6_1802 + 1*F6_1803 + 1*F6_1804 + 1*F6_1805 + 1*F6_1806 + 1*F6_1807 + 1*F6_1809 + 1*F6_1815 + 1*F6_2261 + 1*F6_2262 + 1*F6_2353 + 1*F6_2354 + 1*F6_2435 + 1*F6_BBRM1WA + 1*F6_BBRM2WA + 1*F6_BUSINESSBANKWA + 1*F6_CBWACENTRAL + 1*F6_CBWASOUTH + 1*F6_R&R-WESTCOAST" > paste(MM, regsflat, collapse="\n") [1] "F1_all =~ target\nF2_all =~ target\nF3_all =~ target\nF4_all =~ target\nF5_all =~ target\nF6_all =~ target F1_all ~ 1*F1_0351 + 1*F1_0354 + 1*F1_0414 + 1*F1_0415 + 1*F1_0420 + 1*F1_0430 + 1*F1_0464 + 1*F1_0484 + 1*F1_0488 + 1*F1_0496 + 1*F1_0508 + 1*F1_0517 + 1*F1_0527 + 1*F1_0592 + 1*F1_0593 + 1*F1_0596 + 1*F1_0609 + 1*F1_0640 + 1*F1_0646 + 1*F1_0647 + 1*F1_0683 + 1*F1_0686 + 1*F1_0691 + 1*F1_0696 + 1*F1_0713 + 1*F1_0715 + 1*F1_0717 + 1*F1_0757 + 1*F1_0759 + 1*F1_0764 + 1*F1_0765 + 1*F1_0771 + 1*F1_0772 + 1*F1_0775 + 1*F1_0776 + 1*F1_0778 + 1*F1_0781 + 1*F1_0793 + 1*F1_0796 + 1*F1_0797 + 1*F1_0799 + 1*F1_0842 + 1*F1_0843 + 1*F1_0845 + 1*F1_0865 + 1*F1_0879 + 1*F1_0895 + 1*F1_0936 + 1*F1_1544 + 1*F1_1545 + 1*F1_1802 + 1*F1_1803 + 1*F1_1804 + 1*F1_1805 + 1*F1_1806 + 1*F1_1807 + 1*F1_1809 + 1*F1_1815 + 1*F1_2261 + 1*F1_2262 + 1*F1_2353 + 1*F1_2354 + 1*F1_2435 + 1*F1_BBRM1WA + 1*F1_BBRM2WA + 1*F1_BUSINESSBANKWA + 1*F1_CBWACENTRAL + 1*F1_CBWASOUTH + 1*F1_R&R-WESTCOAST\nF2_all ~ 1*F2_0351 + 1*F2_0354 + 1*F2_0414 + 1*F2_0415 + 1*F2_0420 + 1*F2_0430 + 1*F2_0464 + 1*F2_0484 + 1*F2_0488 + 1*F2_0496 + 1*F2_0508 + 1*F2_0517 + 1*F2_0527 + 1*F2_0592 + 1*F2_0593 + 1*F2_0596 + 1*F2_0609 + 1*F2_0640 + 1*F2_0646 + 1*F2_0647 + 1*F2_0683 + 1*F2_0686 + 1*F2_0691 + 1*F2_0696 + 1*F2_0713 + 1*F2_0715 + 1*F2_0717 + 1*F2_0757 + 1*F2_0759 + 1*F2_0764 + 1*F2_0765 + 1*F2_0771 + 1*F2_0772 + 1*F2_0775 + 1*F2_0776 + 1*F2_0778 + 1*F2_0781 + 1*F2_0793 + 1*F2_0796 + 1*F2_0797 + 1*F2_0799 + 1*F2_0842 + 1*F2_0843 + 1*F2_0845 + 1*F2_0865 + 1*F2_0879 + 1*F2_0895 + 1*F2_0936 + 1*F2_1544 + 1*F2_1545 + 1*F2_1802 + 1*F2_1803 + 1*F2_1804 + 1*F2_1805 + 1*F2_1806 + 1*F2_1807 + 1*F2_1809 + 1*F2_1815 + 1*F2_2261 + 1*F2_2262 + 1*F2_2353 + 1*F2_2354 + 1*F2_2435 + 1*F2_BBRM1WA + 1*F2_BBRM2WA + 1*F2_BUSINESSBANKWA + 1*F2_CBWACENTRAL + 1*F2_CBWASOUTH + 1*F2_R&R-WESTCOAST\nF3_all ~ 1*F3_0351 + 1*F3_0354 + 1*F3_0414 + 1*F3_0415 + 1*F3_0420 + 1*F3_0430 + 1*F3_0464 + 1*F3_0484 + 1*F3_0488 + 1*F3_0496 + 1*F3_0508 + 1*F3_0517 + 1*F3_0527 + 1*F3_0592 + 1*F3_0593 + 1*F3_0596 + 1*F3_0609 + 1*F3_0640 + 1*F3_0646 + 1*F3_0647 + 1*F3_0683 + 1*F3_0686 + 1*F3_0691 + 1*F3_0696 + 1*F3_0713 + 1*F3_0715 + 1*F3_0717 + 1*F3_0757 + 1*F3_0759 + 1*F3_0764 + 1*F3_0765 + 1*F3_0771 + 1*F3_0772 + 1*F3_0775 + 1*F3_0776 + 1*F3_0778 + 1*F3_0781 + 1*F3_0793 + 1*F3_0796 + 1*F3_0797 + 1*F3_0799 + 1*F3_0842 + 1*F3_0843 + 1*F3_0845 + 1*F3_0865 + 1*F3_0879 + 1*F3_0895 + 1*F3_0936 + 1*F3_1544 + 1*F3_1545 + 1*F3_1802 + 1*F3_1803 + 1*F3_1804 + 1*F3_1805 + 1*F3_1806 + 1*F3_1807 + 1*F3_1809 + 1*F3_1815 + 1*F3_2261 + 1*F3_2262 + 1*F3_2353 + 1*F3_2354 + 1*F3_2435 + 1*F3_BBRM1WA + 1*F3_BBRM2WA + 1*F3_BUSINESSBANKWA + 1*F3_CBWACENTRAL + 1*F3_CBWASOUTH + 1*F3_R&R-WESTCOAST\nF4_all ~ 1*F4_0351 + 1*F4_0354 + 1*F4_0414 + 1*F4_0415 + 1*F4_0420 + 1*F4_0430 + 1*F4_0464 + 1*F4_0484 + 1*F4_0488 + 1*F4_0496 + 1*F4_0508 + 1*F4_0517 + 1*F4_0527 + 1*F4_0592 + 1*F4_0593 + 1*F4_0596 + 1*F4_0609 + 1*F4_0640 + 1*F4_0646 + 1*F4_0647 + 1*F4_0683 + 1*F4_0686 + 1*F4_0691 + 1*F4_0696 + 1*F4_0713 + 1*F4_0715 + 1*F4_0717 + 1*F4_0757 + 1*F4_0759 + 1*F4_0764 + 1*F4_0765 + 1*F4_0771 + 1*F4_0772 + 1*F4_0775 + 1*F4_0776 + 1*F4_0778 + 1*F4_0781 + 1*F4_0793 + 1*F4_0796 + 1*F4_0797 + 1*F4_0799 + 1*F4_0842 + 1*F4_0843 + 1*F4_0845 + 1*F4_0865 + 1*F4_0879 + 1*F4_0895 + 1*F4_0936 + 1*F4_1544 + 1*F4_1545 + 1*F4_1802 + 1*F4_1803 + 1*F4_1804 + 1*F4_1805 + 1*F4_1806 + 1*F4_1807 + 1*F4_1809 + 1*F4_1815 + 1*F4_2261 + 1*F4_2262 + 1*F4_2353 + 1*F4_2354 + 1*F4_2435 + 1*F4_BBRM1WA + 1*F4_BBRM2WA + 1*F4_BUSINESSBANKWA + 1*F4_CBWACENTRAL + 1*F4_CBWASOUTH + 1*F4_R&R-WESTCOAST\nF5_all ~ 1*F5_0351 + 1*F5_0354 + 1*F5_0414 + 1*F5_0415 + 1*F5_0420 + 1*F5_0430 + 1*F5_0464 + 1*F5_0484 + 1*F5_0488 + 1*F5_0496 + 1*F5_0508 + 1*F5_0517 + 1*F5_0527 + 1*F5_0592 + 1*F5_0593 + 1*F5_0596 + 1*F5_0609 + 1*F5_0640 + 1*F5_0646 + 1*F5_0647 + 1*F5_0683 + 1*F5_0686 + 1*F5_0691 + 1*F5_0696 + 1*F5_0713 + 1*F5_0715 + 1*F5_0717 + 1*F5_0757 + 1*F5_0759 + 1*F5_0764 + 1*F5_0765 + 1*F5_0771 + 1*F5_0772 + 1*F5_0775 + 1*F5_0776 + 1*F5_0778 + 1*F5_0781 + 1*F5_0793 + 1*F5_0796 + 1*F5_0797 + 1*F5_0799 + 1*F5_0842 + 1*F5_0843 + 1*F5_0845 + 1*F5_0865 + 1*F5_0879 + 1*F5_0895 + 1*F5_0936 + 1*F5_1544 + 1*F5_1545 + 1*F5_1802 + 1*F5_1803 + 1*F5_1804 + 1*F5_1805 + 1*F5_1806 + 1*F5_1807 + 1*F5_1809 + 1*F5_1815 + 1*F5_2261 + 1*F5_2262 + 1*F5_2353 + 1*F5_2354 + 1*F5_2435 + 1*F5_BBRM1WA + 1*F5_BBRM2WA + 1*F5_BUSINESSBANKWA + 1*F5_CBWACENTRAL + 1*F5_CBWASOUTH + 1*F5_R&R-WESTCOAST\nF6_all ~ 1*F6_0351 + 1*F6_0354 + 1*F6_0414 + 1*F6_0415 + 1*F6_0420 + 1*F6_0430 + 1*F6_0464 + 1*F6_0484 + 1*F6_0488 + 1*F6_0496 + 1*F6_0508 + 1*F6_0517 + 1*F6_0527 + 1*F6_0592 + 1*F6_0593 + 1*F6_0596 + 1*F6_0609 + 1*F6_0640 + 1*F6_0646 + 1*F6_0647 + 1*F6_0683 + 1*F6_0686 + 1*F6_0691 + 1*F6_0696 + 1*F6_0713 + 1*F6_0715 + 1*F6_0717 + 1*F6_0757 + 1*F6_0759 + 1*F6_0764 + 1*F6_0765 + 1*F6_0771 + 1*F6_0772 + 1*F6_0775 + 1*F6_0776 + 1*F6_0778 + 1*F6_0781 + 1*F6_0793 + 1*F6_0796 + 1*F6_0797 + 1*F6_0799 + 1*F6_0842 + 1*F6_0843 + 1*F6_0845 + 1*F6_0865 + 1*F6_0879 + 1*F6_0895 + 1*F6_0936 + 1*F6_1544 + 1*F6_1545 + 1*F6_1802 + 1*F6_1803 + 1*F6_1804 + 1*F6_1805 + 1*F6_1806 + 1*F6_1807 + 1*F6_1809 + 1*F6_1815 + 1*F6_2261 + 1*F6_2262 + 1*F6_2353 + 1*F6_2354 + 1*F6_2435 + 1*F6_BBRM1WA + 1*F6_BBRM2WA + 1*F6_BUSINESSBANKWA + 1*F6_CBWACENTRAL + 1*F6_CBWASOUTH + 1*F6_R&R-WESTCOAST" >
Try this: paste(MM, regsflat, sep="\n")
twiiter bootstrap align thumbnails dynamically
i'd like to have the thumbnails aligned dynamically, but how can i do it? i have the following code: HTML <div class="row-fluid"> <ul class="thumbnails"> <uc1:loadUsers runat="server" ID="loadUsers" /> </ul> </div> ASP.NET this is a UserControl _str is a string which will be added to a literal control which converts this to HTML _str = "<li class='span3'>" + "<div class='thumbnail'>" + "<div class='caption'>" + "<h3>" + _name + "</h3>" + "<ul>" + "<li><h5>" + _other + "</h5></li>" + "<li><h5>" + _other + "</h5></li>" + "<li><h5><img src='" + _imagePath + "'" + _size + " /> " + _other + "</h5></li>" + "<br><li>" + "<div class='btn-group'><button class='btn btn-info'>Options</button><button class='btn btn-info dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button><ul class='dropdown-menu'>" + "<li><a href='users.aspx?delete=" + _id + "'><i class='icon-fire'></i> Delete</a></li>" + "<li><a href='users.aspx?edit=" + _id + "'><i class='icon-edit'></i> Edit</a></li>" + "</ul></div>" + "</li>" + "</ul>" + "</div>" + "</div>" + "</li>"; i know that the class='row-fluid' is the responsible for the alignment, how can i use it dinamicly?
The problem was that i was inserting <li> but in HTML i didn't have an <ul>, thats the reason to this to be unformulated dynamically. So i've inserted <div></div> at the beginning and in the end of the dynamic control. i solved this easily: _str = "<div><li class='span3'>" + "<div class='thumbnail'>" + "<div class='caption'>" + "<h3>" + _name + "</h3>" + "<ul>" + "<li><h5>" + _other + "</h5></li>" + "<li><h5>" + _other + "</h5></li>" + "<li><h5><img src='" + _imagePath + "'" + _size + " /> " + _other + "</h5></li>" + "<br><li>" + "<div class='btn-group'><button class='btn btn-info'>Options</button><button class='btn btn-info dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button><ul class='dropdown-menu'>" + "<li><a href='users.aspx?delete=" + _id + "'><i class='icon-fire'></i> Delete</a></li>" + "<li><a href='users.aspx?edit=" + _id + "'><i class='icon-edit'></i> Edit</a></li>" + "</ul></div>" + "</li>" + "</ul>" + "</div>" + "</div>" + "</li></div>";