c#和sql数据库连接 我要用出生日期和当前日期计算年龄

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:45:13
代码我会自己回复在下面

请高手帮我修改

我的程序还是不可以算出年龄

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsApplication3
{
public partial class Form1 : Form
{
private DataSet ds;
private SqlDataAdapter dap;
private bool addflag;
private string oldid;
private DataView dv;
public Form1()
{
InitializeComponent();
}

private void butlianjie_Click(object sender, EventArgs e)
{
ds = new DataSet();
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=gz;Integrated Security=True");
conn.Open();
dap = new SqlDataAdapter("select * from gzb", conn);
dap.MissingS