我试图在SQL Azure中使用数据库.我已经安装了SQL Server 2008.我可以登录SQL Azure并且可以使用master数据库.但我不能使用其他数据库,我在对象资源管理器中看不到任何东西.它显示了这个错误:
"USE statement is not supported to switch between databases. Use a new connection to connect to a different Database."
Run Code Online (Sandbox Code Playgroud)
我怎样才能使用其他数据库?
我们得到了一个传统的vb.net应用程序,它已经工作了多年但是它突然停止工作并且给了sql server超时大部分应用程序都给出了超时错误,例如,一部分是代码:
command2 = New SqlCommand("select * from Acc order by AccDate,AccNo,AccSeq", SBSConnection2)
reader2 = command2.ExecuteReader()
If reader2.HasRows() Then
While reader2.Read()
If IndiAccNo <> reader2("AccNo") Then
CAccNo = CAccNo + 1
CAccSeq = 10001
IndiAccNo = reader2("AccNo")
Else
CAccSeq = CAccSeq + 1
End If
command3 = New SqlCommand("update Acc Set AccNo=@NewAccNo,AccSeq=@NewAccSeq where AccNo=@AccNo and AccSeq=@AccSeq", SBSConnection3)
command3.Parameters.Add("@AccNo", SqlDbType.Int).Value = reader2("AccNo")
command3.Parameters.Add("@AccSeq", SqlDbType.Int).Value = reader2("AccSeq")
command3.Parameters.Add("@NewAccNo", SqlDbType.Int).Value = CAccNo
command3.Parameters.Add("@NewAccSeq", SqlDbType.Int).Value = CAccSeq
command3.ExecuteNonQuery()
End While
End If
Run Code Online (Sandbox Code Playgroud)
它工作,现在在command3.ExecuteNonQuery()任何想法?
~~~~~~~~~~~一些信息: …
是否有可能将包含(限制在另一个元素的边界)添加到jQuery UI的Dialog?
django网站上的教程显示了这些模型的代码:
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
Run Code Online (Sandbox Code Playgroud)
现在,每个属性,都是一个类属性,对吧?因此,所有类的实例都应该共享相同的属性.稍后,他们提出了这段代码:
class Poll(models.Model):
# ...
def __unicode__(self):
return self.question
class Choice(models.Model):
# ...
def __unicode__(self):
return self.choice
Run Code Online (Sandbox Code Playgroud)
他们是如何从类属性转变为实例属性的?我的课程属性错了吗?
我正在尝试重定向用户,如果他们成功登录但我的页面上的代码似乎阻止重定向工作.如果我删除重定向下面的jQuery工作.有人能告诉我,如果有什么我做错了吗?谢谢
我有以下行动:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Login(User user)
{
var myErrors = new Dictionary<string, string>();
try
{
if (ModelState.IsValid)
{
if (userRepository.ValidUser(user))
{
return RedirectToAction("Index", "Group", new {page = (int?)null});
}
else
{
return Json("Username or password seems to be incorrect");
}
}
else
{
foreach (KeyValuePair<string, ModelState> keyValuePair in ViewData.ModelState)
{
if (keyValuePair.Value.Errors.Count > 0)
{
List<string> errors = new List<string>();
myErrors.Add(keyValuePair.Key, keyValuePair.Value.Errors[0].ErrorMessage);
}
}
return Json(myErrors);
}
}
catch (Exception)
{
return Json("Invalid");
}
}
Run Code Online (Sandbox Code Playgroud)
以及我页面上的以下代码:
<script language="javascript" type="text/javascript"> …
Run Code Online (Sandbox Code Playgroud) 我想问一下管理radGrid宽度的最佳实践是什么.
对于我的应用程序,大多数用户运行1280 x 1024,所以我很乐意将我的整体网格宽度设置为1100.但是,根据使用的形式,我有时会有水平滚动条.为了解决这个问题,我一直在玩网格的宽度,我也玩过设置一个或两个列的itemstyle-width.有时我不小心把它弄好了,有时它不太正确.
管理这个的最佳方法是什么?我是设置网格,然后是所有列,还是仅设置网格,还是只设置列?我想有一个最好的做法,所以只是想知道你是如何处理它的,
谢谢
PS.我已经在Telerik论坛上发布了这个,我知道,当然,用相同的帖子粘贴互联网并不被认为是可以接受的,但我确实想使用stackoverflow,并希望我按照规则播放如果我发布也直接在Telerik上.
Mark Breen Mark Breen爱尔兰宝马R80GS 1987
替代文字http://img413.imageshack.us/img413/9417/snapshotapp.jpg
ContextMenuStrip绑定到ListView控件.但是,右键单击选项(编辑)出现在我单击ListView区域的位置,这给了我特殊的错误,因为编辑的实现只能处理选定的行.我只希望它出现在选定的行(蓝色突出显示的行)上.我该怎么做?
我有一个模板,我想专门研究两种int类型,其中一种是普通的int
,另一种是intptr_t
.在64位平台上,它们具有不同的大小,我可以轻松地做到这一点,但在32位上,两种类型都是相同的,编译器会抛出有关重新定义的错误.除了使用预处理器禁用其中一个定义外,我该怎么做才能解决它?
一些代码作为例子:
template<typename T>
type * convert();
template<>
type * convert<int>() { return getProperIntType(sizeof(int)); }
template<>
type * convert<intptr_t>() { return getProperIntType(sizeof(intptr_t)); }
//this template can be specialized with non-integral types as well,
// so I can't just use sizeof() as template parameter.
template<>
type * convert<void>() { return getProperVoidType(); }
Run Code Online (Sandbox Code Playgroud) 我的GUI上有6个按钮.可以通过复选框配置按钮的可见性.选中复选框并保存意味着应显示相应按钮.我想知道是否有可能在数据库中有一个TinyInt列表示所有6个按钮的可见性.
我为按钮创建了一个枚举,看起来像这样:
public enum MyButtons
{
Button1 = 1,
Button2 = 2,
Button3 = 3,
Button4 = 4,
Button5 = 5,
Button6 = 6
}
Run Code Online (Sandbox Code Playgroud)
现在我想知道怎么说,例如只使用这一列检查button1,button5和button6.可能吗?
谢谢 :-)
c# ×3
jquery ×2
vb.net ×2
.net ×1
32-bit ×1
64-bit ×1
asp.net ×1
asp.net-mvc ×1
attributes ×1
c++ ×1
dialog ×1
django ×1
enums ×1
javascript ×1
jquery-ui ×1
python ×1
radgrid ×1
rhino-mocks ×1
sql ×1
sql-server ×1
telerik ×1
templates ×1
timeout ×1
tinyint ×1
visibility ×1
winforms ×1