我已经在IIS 7.5中启动了我的网站.网站上有一个问题,我试图解决它.在做了更改之后我构建了解决方案,并试图在网站上查看.那时我得到一个例外细节,如
System.Data.SqlClient.SqlException:用户'sa'登录失败"
这是源错误
Line 25: /// <param name="dataTable"><see>System.Data.DataTalbe</see> a rellenar</param>
Line 26: public void FillTable(System.Data.DataTable dataTable)
{
this.Adapter.SelectCommand = this.CommandCollection[0];
this.Adapter.Fill(dataTable);
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我解决这个问题吗?
我有一个名为类animal,它有public string name,species和public Byte photoAnimal.
在另一种形式我创建名为Simba的动物,我想设置Simba的值,但是当我想设置photoAnimal我得到的错误.我使用filestream和binaryreader读取数据,然后create byte[] imageData = binary从filestream二进制读取器读取数据.我不能设置Simba.photoAnimal = imageData,这是我的一些代码:
animal Simba = new animal();
string fileName = textBox5.Text;
byte[] ImageData;
fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
br = new BinaryReader(fs);
ImageData = br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
Simba.name = textBox1.Text;
Simba.species = textBox2.Text;
Simba.photoAnimal = ImageData; // error
Run Code Online (Sandbox Code Playgroud) 我本来希望明天为新年派对写一个倒数计时器,但我似乎遇到了从彼此减去两个DateTimes的问题.
我的应用程序似乎在处理2015年1月的日期(第一种方法)时工作正常,但是当我越过2014/2015年度边界(第二种方法)时,它会给出奇怪的结果.
有任何想法吗?
private static readonly string MyDateFormat = "{0:" + string.Join("", (-1).ToString("x").Skip(1)) + "}";
public void disKoud()
{
var later = new DateTime(2015-01-01);
var now = new DateTime(2015-01-31);
var diff = (later - now);
Debug.WriteLine(MyDateFormat, diff); // 0000030
}
public void sonderNHoed()
{
var later = new DateTime(2015-01-01);
var now = new DateTime(2014-12-31);
var diff = (later - now);
Debug.WriteLine(MyDateFormat, diff); // 0000042 ??? WTF
}
Run Code Online (Sandbox Code Playgroud) 我创建了sql proc来从数据库中选择记录它成功执行但没有返回任何内容
任何人都可以告诉我在哪里做错了吗?
CREATE PROC [dbo].[bb_EmailSentStatus]
@type varchar
AS
SET NOCOUNT ON
SET XACT_ABORT ON
BEGIN TRAN
IF (@type='pending')
BEGIN
SELECT [Mail_Track_Id], [FromName],[FromEmail],[ToName],[ToEmail],[ReplyTo],
[Subject],[CreatedDate],[ModifiedDate],[Server_Msg],[FromSource]
FROM [dbo].[Mail_Track]
WHERE Active_Status=1 AND Sent_Status IS NULL
END
ELSE IF(@type='failed')
BEGIN
SELECT [Mail_Track_Id], [FromName],[FromEmail],[ToName],[ToEmail],[ReplyTo],
[Subject],[CreatedDate],[ModifiedDate],[Server_Msg],[FromSource]
FROM [dbo].[Mail_Track]
WHERE Active_Status=1 AND Sent_Status = 0
END
ELSE IF(@type='success')
BEGIN
SELECT [Mail_Track_Id], [FromName],[FromEmail],[ToName],[ToEmail],[ReplyTo],
[Subject],[CreatedDate],[ModifiedDate],[Server_Msg],[FromSource]
FROM [dbo].[Mail_Track]
WHERE Active_Status=1 AND Sent_Status = 1
END
COMMIT
Run Code Online (Sandbox Code Playgroud) 每当我启动程序时,都会出现Windows弹出窗口并显示"test.exe已停止工作".我的编译器没有错误.这是我的代码.我已经提到了错误发生的地方,但我无法弄明白.
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long factor[999], halfof;
int i;
long long num = 600851475143;
halfof = num / 2;
for (i = 0; i < 999; i++){
factor[i] = 0;
}
//GETTING ERROR IN THIS "FOR LOOP"
for (i = 2; i <= halfof; i++){
if (num % i == 0){
factor[i] = i;
}
}
for (i = 0; i < 999; i++){
printf("%ld", factor[i]);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud) select tmp.id, tmp.portfolio,
ROW_NUMBER() OVER(order by tmp.id DESC) AS RowNum
from
(select r.portfolio, r.id
from research r
where r.created_by = 'Adam Cohen'
) as tmp
WHERE RowNum BETWEEN 5 AND 10;
Run Code Online (Sandbox Code Playgroud)
我无法在 where 条件中引用 RowNum,因为它显示无效的列名“RowNum”。请帮助我使用正确的语法来获得结果。
编辑 - 更改要求
SELECT * FROM
(
select id, portfolio,
CASE WHEN l.posted_on IS NULL
THEN CONVERT(VARCHAR(40),l.created_on,120)
ELSE CONVERT(VARCHAR(40),l.posted_on,120)
END AS sort_by,
ROW_NUMBER() OVER(order by sort_by DESC) AS RowNum
from research
where created_by = 'Adam Cohen'
) x
WHERE x.RowNum BETWEEN 5 AND 10
Run Code Online (Sandbox Code Playgroud)
我试图包含 …
*#include<iostream.h>
class complex
{
int a,b;
public:
complex(int x,int y)
{
a = x;
b = y;
cout<<"a and b is\n"<<a<<b<<endl;
}
complex operator+(complex ob)
{
complex t;
t.a=a+ob.a;
t.b=b+ob.b;
return(t);
}
};
int main()
{
complex a(5,6);
complex b(7,8);
complex c;
c = a+b;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我正面临着这个错误:
ll.cpp: In member function âcomplex complex::operator+(complex)â:
ll.cpp:15: error: no matching function for call to âcomplex::complex()â
ll.cpp:7: note: candidates are: complex::complex(int, int)
Run Code Online (Sandbox Code Playgroud)