我使用的是Visual Studio 2010 premium,我使用Visual Studio数据库工具创建了一个数据库.我将字段设置为主键,我想让它自动递增.
但是,当我查看属性时,它不活跃.我的意思是我无法使用Visual Studio 2010 premium内置数据库工具进行设置.我无法设置标识规范.是因为我使用Visual Studio 2010 premium?如何使productID列自动递增?

我正在使用C#StreamWritier类.问题:
我正在创建这样的文件:
private void button1_Click(object sender, EventArgs e)
{
SaveFileDialog save = new SaveFileDialog();
save.FileName = textBox1.Text;
save.Filter = "Text File | *.rtf";
if (save.ShowDialog() == DialogResult.OK)
{
StreamWriter writer = new StreamWriter(save.OpenFile());
writer.WriteLine(textBox2.Text);
}
writer.Dispose();
writer.Close();
}
Run Code Online (Sandbox Code Playgroud) 我有两种形式,我将其中一种形式的TopMost属性设置为true.在某个地方,当程序运行时,我显示一个MessageBox,但由于TopMost设置为true,当MessageBox弹出时,它显示在最顶层的表单下,所以我看不到它.
有没有什么方法可以让我的一个表单总是在顶部,但是当一个MessageBox弹出时,让消息框显示在该特定表单的顶部?
是否可以为MessageBox提供一个位置,以便它不显示在中间但例如屏幕上的低位?
假设我有一个橙色的表单,我可以只为该特定应用程序设置一个粉红色的消息框.我的意思是我不是指播放Windows颜色属性.(我不希望所有消息框都是粉红色的.)
我使用Visual Studio 2010,我想要一个1280*1024的表单,但我只能有1280*768.它接缝VS2010不让我有一个比我支持的屏幕分辨率更大的形式,这是1366*768因此我不能使形式大于1366*768.
问题是:有没有办法让VS2010的格式大于我的屏幕分辨率?(我知道我们可以在VS2008上制作它,但VS2010有没有办法?)
除此之外的任何其他解决方案都是受
编辑:
问题是我无法替换并将组件放在正确的位置,因为我无法在Form1.cs [Design]上看到所有空间.
我想知道为什么这段代码不起作用?
SqlCommand comand = new SqlCommand();
//string myConnectionString = "Data Source=.\SQLEXPRESS;Initial Catalog=try;Integrated Security=True;Pooling=False";
SqlConnection conn = new SqlConnection(@"server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\mydatabase.mdf;Integrated Security=True;User Instance=True");
comand.Connection = conn;
conn.Open();
comand.CommandText = "INSERT INTO TableProduct (productID,productName) VALUES ('1','M')";
comand.ExecuteNonQuery();
conn.Close();
Run Code Online (Sandbox Code Playgroud) 在查看具有多个项目的解决方案时:
1)为什么我们要添加对其他项目的引用?我们不能只使用继承吗?
2)在使用Visual Studio添加引用之后,为什么我们必须将项目添加到命名空间系统?例如:using myReferenceProject;我认为IDE会这样做.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using myReferenceProject;
using System.Data.SqlClient;
using System.Data;
Run Code Online (Sandbox Code Playgroud) c# ×4
file ×1
inheritance ×1
messagebox ×1
namespaces ×1
reference ×1
sql-server ×1
streamwriter ×1
winforms ×1