简体   繁体   English

如何使用Asp.net中的Details视图在MYSQL数据库中插入,删除,编辑记录

[英]How to insert,Delete,Edit record in MYSQL database using Details View in Asp.net

I am new in asp net . 我是ASP网络的新手。

I wanted to is there any way to insert, delete and edit rows using details view directly 我想使用直接查看详细信息的方法来插入,删除和编辑行

by a string. 一串。

I am using these connection string for connecting mysql database 我正在使用这些连接字符串来连接mysql数据库

server=localhost;User Id=root;password=test;database=mydatabase

when I use mdf file I see the insert, delete and edit option, but when I look the options by using directly connection string I can't see it 当我使用mdf文件时,我看到了插入,删除和编辑选项,但是当我直接使用连接字符串查看这些选项时,却看不到它

Thanks in advance 提前致谢

You'll want to put that connection string in your web.config (look up 'connectionstrings'). 您需要将该连接字符串放在web.config中(查找“ connectionstrings”)。 And then use an objectdatasource. 然后使用一个objectdatasource。 They can connect to the MySQL database. 他们可以连接到MySQL数据库。

However, you typically do not want to put select/insert/delete statements in your code and will want to write procedures for those. 但是,您通常不希望在代码中放入select / insert / delete语句,而是想为它们编写过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM