|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 06/22/2009 at 10:29PM PDT, ID: 24513578 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: |
protected void Page_Load(object sender, EventArgs e)
{
DataTable dtExcelData = new DataTable();
OleDbDataAdapter daExcelData = new OleDbDataAdapter();
//OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\MakeMyTrip\\1AiiiiVivek.xlsx;Extended Properties = " + Convert.ToChar(34).ToString() + "Excel 12.0;HDR=Yes;IMEX=1" + Convert.ToChar(34).ToString());
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\MakeMyTrip\\Book1.xlsx;Extended Properties = " + Convert.ToChar(34).ToString() + "Excel 12.0;HDR=No;IMEX=1" + Convert.ToChar(34).ToString());
conn.Open();
OleDbCommand ExcelCommand = new OleDbCommand();
ExcelCommand.Connection = conn;
DataTable tblExcelSheet = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
string SpreadSheetName = "[" + tblExcelSheet.Rows[0]["TABLE_NAME"].ToString() + "]";
conn.Close();
//DataTable dtPurExcelColsSheet = new DataTable();
string sQuery, filterString,DerivedfilterString;
//filterString = "and [SrNo] > 2";
filterString = " ";
//DerivedfilterString = " and [Amount] > 9"; //'AA-' +
DerivedfilterString = "";
//sQuery = "Select 'AA-' + str([SrNo]) from " + SpreadSheetName + " where 1=1 ";
//sQuery = "Select [B/Fare + Taxes] + [SerTax on Base Fare @ 60%] + [SerTax on Base Fare @2%] as Total,'AA' + Format([External Document No]) + 'BB' as DocumentNo,Mid(Format([SerTax on Base Fare @ 60%]),1,2) from " + SpreadSheetName + " where 1=1 ";
//sQuery = "Select [Advance133] + [Balance144] as Total,'AA' + Format([Account No88]) + 'BB' as AccountNo,Mid(Format([Credit Card No99]),1,2) from " + SpreadSheetName + " where 1=1 ";
sQuery = "select [Account No.88] from " + SpreadSheetName + " where 1=1 ";
if (filterString != "")
{
sQuery = sQuery + filterString;
}
if (DerivedfilterString != "")
{
sQuery = sQuery + DerivedfilterString;
}
//sQuery = "Select * from [Sheet1$] where 1=1 and [SrNo] > 2 and [Amount] > 9";
daExcelData = new OleDbDataAdapter(sQuery, conn);
//daExcelData = new OleDbDataAdapter("Select * from " + SpreadSheetName, conn);
daExcelData.TableMappings.Add("Table", "ExcelData");
daExcelData.Fill(dtExcelData);
}
|
Advertisement