我只想知道远程sql server express版的正确sql连接字符串.
这就是我得到的,但我遇到了一些问题
SqlConnection cs = new SqlConnection(@"Data Source=(IP Address)\PC-NAME\SQLEXPRESS,1433;Network Library=DBMSSOCN;Initial Catalog=dbase;User ID=sa;Password=password");
Run Code Online (Sandbox Code Playgroud)
我在C#调试器中遇到此错误:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection …Run Code Online (Sandbox Code Playgroud) 我有一个INSERT INTO ... SELECT声明,将数据从一个表复制到另一个表.
但事实是,第二个表中的AutoNumber列值是从第一个表中的最后一个数字开始的.
意味着第一个表的计数是2000,那么,第二个表从2001年开始.
使用Access数据库,如何重置此值?
美好的一天,伙计们。
我目前正在创建某种广告应用程序。这是从上到下滚动的简单文本,并且会再次重复。我目前正在使用 listview 在 C# 中执行此操作。将在列表视图中显示的文本将来自数据库。我正在使用计时器自动刷新表单。问题是如何在每次加载表单时自动移动它或从上到下滚动它,并在每次完成时再次重复。
谢谢。
这是目前King King先生要求的代码。
private void timer1_Tick(object sender, EventArgs e)
{
this.Refresh();
listView1.TopItem = listView1.Items.Cast<ListViewItem>().LastOrDefault();
}
Run Code Online (Sandbox Code Playgroud) 我想使用进度条创建一个基本的多线程应用程序。这意味着当主线程忙于正在执行的大进程时,该进度条将在不同的线程上运行。我看过很多关于它的教程。但它们是多线程的,是执行大型进程的。另一种形式的进度条仅显示一个使用计时器运行和完成的简单进度条。
这是我现在的代码。
对于线程:
public void thread()
{
Form6 for6 = new Form6();
for6.Show();
}
TH1 = new Thread(thread);
TH1.Start();
Run Code Online (Sandbox Code Playgroud)
对于进度条(表格6内的代码)
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Increment(+1);
if (progressBar1.Value == 99)
{
this.Close();
}
}
private void Form6_Load(object sender, EventArgs e)
{
timer1.Start();
}
Run Code Online (Sandbox Code Playgroud)
我的问题是这里的线程不运行 Form6。我有什么办法可以做到这一点吗?
以下是我的代码
public Tuple<string, string> GetMultipleValue()
{
frmKbCPT mFrmKbCpt = new frmKbCPT();
mFrmKbCpt.MaximizeBox = false;
mFrmKbCpt.Height = 600;
mFrmKbCpt.Width = 800;
mFrmKbCpt.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
mFrmKbCpt.ShowDialog();
string cptrate = mFrmKbCpt.txtRate.Text;
string mStr = mFrmKbCpt.txtCode.Text;
mFrmKbCpt.Dispose();
return Tuple.Create(cptrate, mStr);
}
Run Code Online (Sandbox Code Playgroud)
在按钮中,如果我想填充两个文本框,我这样做
Tuple<string, string> getvalue = new Tuple<string, string>(GetMultipleValue().Item1, GetMultipleValue().Item2);
txtCPT1.Text = getvalue.Item1;
txtCpt1Prate_opdamt.Text = getvalue.Item2;
Run Code Online (Sandbox Code Playgroud)
我的问题是它显示我的表格frmKbCPT两次.有没有办法获取元组item2而不重复函数GetMultipleValue()?谢谢,更多的力量!
以下是我的代码
private void btnCptKb5_Click(object sender, EventArgs e)
{
Form1 form1 = new Form1();
textbox1.text = form1.textbox1.text;
}
Run Code Online (Sandbox Code Playgroud)
为什么我不能复制form1文本框的值?
我在这个网站上下载了这个程序,这是一个屏幕键盘.
http://www.codeproject.com/KB/miscctrl/touchscreenkeyboard/touchscreenkeyboard_src.zip
我是否正确使用此程序或将其添加到我现有的c#程序中是仅使用dll?
如果是这样我怎么称呼它?
c# ×6
.net ×3
winforms ×3
autonumber ×1
listview ×1
ms-access ×1
sql ×1
sql-insert ×1
sql-server ×1
textbox ×1
tuples ×1