我正在使用紧凑框架在我的Windows移动设备中为MySQLConnection创建一个hello word应用程序。 我已经从http://dev.mysql.com/downloads/connector/net/
下载了mysql dll要添加DLL,我将dll放在debug文件夹中(尝试放置在项目结构中的任何位置),右键单击项目引用,然后添加引用并浏览到dll文件。
代码:
<?php
try {
$stmt = $db->query('SELECT postID, postTitle, postDesc, postDate FROM blog_posts ORDER BY postID DESC');
while($row = $stmt->fetch()){
echo '<div>';
echo '<h1><a href="viewpost.php?id='.$row['postID'].'">'.$row['postTitle'].'</a></h1>';
echo '<p>Posted on '.date('jS M Y H:i:s', strtotime($row['postDate'])).'</p>';
echo '<p>'.$row['postDesc'].'</p>';
echo '<p><a href="viewpost.php?id='.$row['postID'].'">Read More</a></p>';
echo '</div>';
}
} catch(PDOException $e) {
echo $e->getMessage();
}
?>
当我运行时,我得到了,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using MySql.Data.MySqlClient;
namespace MySQLSample
{
public partial class Form1 : Form
{
private MySqlConnection conn;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}