如何从具有特定代码的Excel工作表中获取数据

时间:2019-07-09 08:15:15

标签: asp.net excel c#-4.0

我的代码有一个问题,我无法从我的代码中实现mobile no:

OleDbCommand cmdoledb = new OleDbCommand("Select [Phone(R)] from [nil$] where [Code]='" + treadcode + "' ", oledbConn);
mobileno = cmdoledb.ExecuteScalar().ToString();
string message = "Dear " + clientname + " Your BSE Trade Position: " + Codemsg + "  Ledger balance is : " + purebalance + ". (Aadinath)";
Int64 len = message.Length;
if (!string.IsNullOrEmpty(mobileno.Trim()))
{
    dsmsg.Tables[0].Rows.Add(true, message, len, mobileno, clientname, treadcode);
}
else
{
    dsmsg.Tables[0].Rows.Add(true, message, len,"No Mobile Found", clientname, treadcode);
}

这是我的excel工作表屏幕截图:

enter image description here

0 个答案:

没有答案