替换“:"空格符号(冒号) [英] Replace ":" symbol (colon) by a space

查看:367
本文介绍了替换“:"空格符号(冒号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个将Excel文件转换为Access数据库的应用程序.转换期间,MACAddress列中数据中的:"符号需要用空格替换.

我试图通过使用replace方法来修改查询.但是它没有锻炼.下面给出的是当前使用的查询:

I have created an application which converts Excel files to Access databases. During conversion the ":" symbol in data at the MACAddress column need to be replaced by a space.

I tried to modify the query by using replace method. But it didn''t workout. Given below is the query that currently use:

cmd.CommandText = "INSERT INTO [MS Access;Database=" + Access + "].[NMS_List_Export] SELECT [IP Address] as [IPAddress],[MAC Address] as [MACAddress],[Last seen on Channel] as [LastseenonChannel] FROM [NMS_List_Export$]";


有人可以帮我解决这个问题.


Can somebody please help me on this issue. thanks in advance!!

推荐答案

";


有人可以帮我解决这个问题.首先,谢谢!!!


Can somebody please help me on this issue. thanks in advance!!


首先,您需要从电子表格中检索数据-一次一行.检索数据后,即可根据需要进行操作.之后,您可以将其插入表中.简短的版本是您必须将过程分解为几个步骤,以便您可以实际控制正在发生的事情.

继续并进行编码.
First, you need to retrieve the data from the spreadsheet - one row at a time. Once you''ve retrieved the data, THEN you manipulate it as desired. After that, you can insert it into your table. The short version is that you have to break your process into steps so that you can actually control what''s going on.

Go forth, and code.


在此查询的Select 部分中, INSERT INTO [MS Access; Database ="+ Access +"].[NMS_List_Export] SELECT从[NMS_List_Export
In this query, in the Select part, INSERT INTO [MS Access;Database=" + Access + "].[NMS_List_Export] SELECT [IP Address] as [IPAddress],[MAC Address] as [MACAddress],[Last seen on Channel] as [LastseenonChannel] FROM [NMS_List_Export


这篇关于替换“:"空格符号(冒号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆