我想将二进制图像显示到名为'gvExistedCharacter'的网格视图中.我做过关于它的研究,其中许多建议使用处理程序.但是,我不知道我该怎么做.
仅供参考:数据库中图像的数据类型为image,名为"blueBallImage".我还想在同一个gridview中显示它的int级别.
我试过了
SqlConnection con = new SqlConnection(@"Data Source=localhost;Initial Catalog=MyCloudGames;Integrated Security=True");
SqlCommand cmd = new SqlCommand("Select blueBallImage FROM CorrespondingBall", con);
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = con;
SqlParameter ImageID = new SqlParameter("@characterID", System.Data.SqlDbType.Int);
ImageID.Value = context.Request.QueryString["characterID"];
cmd.Parameters.Add(ImageID);
con.Open();
SqlDataReader dReader = cmd.ExecuteReader();
dReader.Read();
context.Response.BinaryWrite((byte[])dReader["Image"]);
dReader.Close();
con.Close();
Run Code Online (Sandbox Code Playgroud)
我收到错误"参数化查询"(@characterID int)选择blueBallImage FROM CorrespondingBall'需要参数'@characterID',这是未提供的."
我Dropdownlist在我的网页上有如下内容.
<asp:DropDownList runat="server" ID="cboNoOfSubjects" AutoPostBack="true" CssClass="textEntry" width="80%" onclick="javascript:shouldsubmit=false;" ValidationGroup="valCourseFees">
<asp:ListItem Value="0">-Select-</asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5">5</asp:ListItem>
</asp:DropDownList>
<font color ="red">*</font>
<asp:RequiredFieldValidator ID="cboNoOfSubjects_RequiredFieldValidator"
runat="server" ErrorMessage="No. of Subjects Required" ForeColor="Red"
Font-Size="0.9em" ControlToValidate="cboNoOfSubjects"
ValidationGroup="valCourseFees" Display="None"></asp:RequiredFieldValidator>
Run Code Online (Sandbox Code Playgroud)
但验证器似乎没有发射.谁能帮我这个?
我是ML编程的新手,我有一个编写函数is_older的函数,它接受两个日期并计算为true或false.如果第一个参数是第二个参数之前的日期,则计算结果为true.
(如果两个日期相同,则结果为false.)
val is_older = fn : (int * int * int) * (int * int * int) -> bool // Binding Like
Run Code Online (Sandbox Code Playgroud)
我试过这个(使用SML of New Jersy cmd提示)
fun is_older((y1,m1,d1),(y2,m2,d2))= if (y1<y2) then true
else if (y1=y2 andalso m1<m2) then true
else if (y1=y2 andalso m1=m2 andalso d1<d2) then true;
Run Code Online (Sandbox Code Playgroud)
它给出了错误
Error syntax error: deleting SEMICOLON ID
Run Code Online (Sandbox Code Playgroud) 我想知道如何BuildResult在运行时构建C#项目后得到错误.
在妈妈,我有这个:
string projectFileName = @"C:\Users\Inspire\Documents\Mono Projects\Library\Library\Library.csproj";
FileLogger fileLogger = new FileLogger();
fileLogger.Parameters = @"logfile=" + @"C:\Users\Inspire\Documents\Mono Projects\Library\Library\log.text";
ProjectCollection projectCollection = new ProjectCollection();
projectCollection.RegisterLogger(fileLogger);
Dictionary<string, string> GlobalProperty = new Dictionary<string, string>();
GlobalProperty.Add("Configuration", "Debug");
GlobalProperty.Add("Platform", "x86");
BuildRequestData buildRequest = new BuildRequestData(projectFileName, GlobalProperty, null, new string[] { "Build" }, null);
BuildResult buildResult = BuildManager.DefaultBuildManager.Build(new BuildParameters(projectCollection), buildRequest);
projectCollection.UnregisterAllLoggers();
Console.WriteLine(buildResult.OverallResult.ToString());
/* TODO: handle errors */
Run Code Online (Sandbox Code Playgroud)
我想知道错误,所以我可以在构建之后处理它们(这里是注释部分"处理错误"),我已经添加了一个FileLogger文件,你可以看到,但文件总是空的(有错误或没有).
谢谢
我正在使用AlertifyJQuery插件来显示alert,confirm, dialog框.
问题面临确认,它无法正常工作或取消点击
JS代码:
function myconfrm() {
var falgset = true;
alertify.confirm("Are you sure to delete this record.", function (e) {
if (e) {
// user clicked "ok"
falgset = false;
}
});
alert(falgset);
return falgset;
}
$("#btn").live('click', function (event) {
if (myconfrm()) {
// my ajax call
}
});
Run Code Online (Sandbox Code Playgroud) 我想知道是否有从一个特定的搜索方式指数在LINQ
这就是我想要做的例子:
//search after the 4th element if exist any true
bool result = myList.Any(a=>a.flagTodo)
// in my case I want to do like: myList.where(a=>a.index >4).Any(a=>a.flagTodo)
Run Code Online (Sandbox Code Playgroud)
有没有办法在同一个linq中做到这一点?
我有一个Property类列表,其中包含Start和End时间作为属性,如: List<PropSchedules>
PropSchedules
{
DateTime StartTime,
DateTime EndTime
}
Run Code Online (Sandbox Code Playgroud)
值如下:
Starttime EndTime
07:00 09:00
11:00 14:00
15:00 20:00
Run Code Online (Sandbox Code Playgroud)
现在我有时间,我想知道哪一个是最低的启动时间.
就像我有时间说,10:00然后第二项最低.
所以,任何人都有一些快捷方式来获得相同或我必须做循环并检查每一个.
在示例DEMO中,
我希望在类.drow1 .subval失去焦点时触发事件,可能会遗漏某些东西,
JS:
$(".drow1 .sub_val").on('blur',funtion(){
alert("hello");
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<table border="1">
<tr>
<th>Col 1</th>
<th>Col 2</th>
<th>Type</th>
</tr>
<tr>
<td> one</td>
<td>
<input type="text" value="600" class="sub_val" />
</td>
<td>dummy text</td>
</tr>
<tr class="drow1">
<td> Two</td>
<td>
<input type="text" value="50" class="sub_val" />
</td>
<td>drow1</td>
</tr>
<tr class="drow1">
<td> Three</td>
<td>
<input type="text" value="30" class="sub_val" />
</td>
<td>drow1</td>
</tr>
<tr class="drow2">
<td> Four</td>
<td>
<input type="text" value="30" class="sub_val" />
</td>
<td>drow 2</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
编辑:具有类的表行.drow1是动态创建的,因此它不会起火
这里有一个子div在锚标签内,如何得到子div的click事件,例如如果用户点击具有类.press_me alert msg的div 得到显示,如果用户点击主div上的任何地方它应该重定向到相应的锚链接
HTML:
<a href="https://www.google.co.in"><div class="dv_child"> America <div class="press_me">click me</div></div></a>
<a href="https://www.google.co.in" target="_blank"><div class="dv_child"> India <div class="press_me">click me</div></div></a>
<a href="https://www.google.co.in" target="_blank"><div class="dv_child"> Russia <div class="press_me">click me</div></div></a>
<a href="https://www.google.co.in" target="_blank"><div class="dv_child"> Germany <div class="press_me">click me</div></div></a>
Run Code Online (Sandbox Code Playgroud)
JQUERY:
$(".press_me").on('click', function () {
alert($(this).parent().html());
});
Run Code Online (Sandbox Code Playgroud) c# ×4
javascript ×3
jquery ×3
asp.net ×2
.net ×1
alert ×1
alertify ×1
build ×1
collections ×1
dropdownbox ×1
html ×1
image ×1
linq ×1
logging ×1
ml ×1
sml ×1
smlnj ×1
sql-server ×1
t-sql ×1