我在询问如何通过上传按钮将insert
文件xls
转换为SQL Server
。
我在SQL Server
中有一个现有表,该表由列
sno(id)
,customername
,customeridentity
,detail
。
第sno
,customername
和customeridentity
列已被填充,剩下的细节xls
需要其他人通过“选定的行。
我怎么insert
将xls
文件SQL Server
ID
到public final class ClockApp extends Application {
@Override
public void onCreate() {
super.onCreate();
startService(new Intent(getApplicationContext(), MyService.class));
}
}
?
我的代码
Protected Sub DataUpload_Click(sender As Object, e As EventArgs) Dim filepath As String = "C:\New folder\" + XXUpload.UploadedFiles.ToArray(0).FileName.ToString + ".xls" Dim con, con1 As New OleDbConnection Dim cmd, cmd1 As New OleDbCommand Dim dt1 As New DataTable con.ConnectionString = "Data Source=xx;Initial Catalog=xx;User Id=xx;Password=xx;Provider=SQLNCLI10" con.Open() cmd.Connection = con cmd.CommandText = "Update RequestClip Set Detail = @details Where sno IN(Select sno from RequestClip); " cmd.Parameters.AddWithValue("@details", filepath) cmd.ExecuteNonQuery() con.Close() ClipGrid.DataBind() End Sub
预期产量
sno customername customeridentity detail 1 john 1 123.xls 2 max 2 223.xls