English 中文(简体)
• 如何在使用c#时插入一行。
原标题:How do i insert a row in to access using c#
  • 时间:2010-06-29 14:01:15
  •  标签:
  • c#
  • ms-access

我是新事物,我都想从头开始,在进入数据库中插入一行。

我在使用Microsoft Vision C# 表示2010年时,我增加了一个数据集,对从这里到哪里去的路段感到不满。

我看着眼光等等,对我没有任何工作。

我一直在尝试这一法典:

        DataRow newCustomersRow = timeDataSet.Tables["theTimes"].NewRow();
        newCustomersRow["ID"] = "1";
        newCustomersRow["User"] = "Test Name";
        newCustomersRow["LieuHours"] = "23";
        timeDataSet.Tables["theTimes"].Rows.Add(newCustomersRow);

表中只有3个表层,这是我正在展开的更大项目。

请让我有所帮助?

问题回答

在你的数据集中加上一张表格,你可以通过斜体界定你的插入/替代/更新/选择方法。 请插入一行:

    using (timeDataSetTableAdapter ta = new timeDataSetTableAdapter())
{
    ta.Insert(1, "Test Name", "23");
}

这同你试图做的那样。

还读到:http://msdn.microsoft.com/en-us/library/ms1719 3528VS.80%29.aspx





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签