re: 想写一本测试的电子书了 求知无傲 2008-06-19 15:52
呵呵。期待续集。感觉很温馨喔。哈哈。
我用的是 sqlserver 2000, 从网上要了一个通用存储过程,有两个 out 参数,
@pageCount int = 1 output, ----查询结果分页后的总页数
@Counts int = 1 output, ----查询到的记录数
我在BLL 的方法不能传递这两个参数进去。
参数初始化:
int pageCount =1;
int Counts = 10;
方法:
return tbNewsTableAdapter.GetNewsByPageList(tableName, null, pageSize, pageIndex, fldSort, false, null, id, false, ref pageCount, ref Counts, ref strSql);
报错是:
参数“10”: 无法从“ref int”转换为“ref int?”
参数“11”: 无法从“ref int”转换为“ref int?”
LZ有办法解决吗???
re: WebService异常 yc 2008-04-17 15:15
webRequest.KeepAlive = false;
??
看msdn上说的,如果想持久连接应该设置成 true 吧。如下:
【将此属性设置为 true 以发送带有 Keep-alive 值的 Connection HTTP 标头。应用程序使用 KeepAlive 指示持久连接的首选项。当 KeepAlive 属性为 true 时,应用程序与支持它们的服务器建立持久连接。
】
楼主,请确认。。(*^__^*) 嘻嘻……
刚看了一章,觉得写得很好, 比我卖的两个砖头有用多啦,
什么时候可以买到书阿?或者书名叫什么?我搜索不到SCOTT MITCHELL的书名,中文,英文太差可能看几年都看不出所然,,呵呵
re: 测试之一::聊聊软件生命周期 yufan 2008-02-28 16:43
很好,受教了,多谢你把经验分享出来
// Limit the results through a PagedDataSource
PagedDataSource pagedData = new PagedDataSource();
pagedData.DataSource = products.DefaultView;
pagedData.AllowPaging = true;
pagedData.CurrentPageIndex = pageIndex;
pagedData.PageSize = pageSize;
return pagedData;
为什么这里pagedData.DataSource = products.DefaultView;而不是products.Rows呢?那 四十四章 DataList和Repeater数据分页中,这里要使用pagedData.DataSource = products.Rows呢?二者有什么区别?能解释一下吗?谢谢!
文中:记得这两个button的CommandName属性必须分别设为“Update” 和“Cancel”。
请问,为什么必须分别设为“Update” 和“Cancel”。难道不可以用别的吗?
能解释一下吗?谢谢!
无私的人,让我们为他欢呼鼓掌!
要是能提供打包下载就更好了!
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSsssssssssssssssssssssssssssssssssssssssssssssssssssss
@asily
同样的问题,最后还是用了别的方法用0或default value来填空原有的NULL值。
pageddatasourse在转换时还是会一点小的BUG。
re: 登陆时加上验证码 yangedie 2007-10-10 17:43
哦,搞定了,没有仔细看,不好意思。应该是Request.Cookies["CheckCode"].Value
re: 登陆时加上验证码 yangedie 2007-10-07 18:55
有点奇怪哦,为什么我用楼主的Response.Cookies["CheckCode"].Value总是得不到数据,必须放在Session才可以读取,是不是我的ie设置的问题阿
嗯。原来在ProductsOptimisticConcurrencyBLL的DeleteProduct()那里把
return AffectedRow == 1;
写成了return AffectedRow == -1;
谢谢了。
To Nicholas Yuen:
其实你调试一下就知道问题在哪了 :)
为什么正常删除了记录后那个提示并发删除错误的Label还是会显示出来的呢?
用下载的代码测试也是一样。
1 [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, false)]
2 public bool UpdateProduct(
3 // new parameter values
4 string productName, decimal? unitPrice, int productID,
5 // original parameter values
6 string original_productName, decimal? original_unitPrice, int original_productID)
7 {
8 NorthwindOptimisticConcurrency.ProductsOptimisticConcurrencyDataTable products = Adapter.GetProductByProductID(original_productID);
9 if (products.Count == 0)
10 // no matching record found, return false
11 return false;
12
13 NorthwindOptimisticConcurrency.ProductsOptimisticConcurrencyRow product = products[0];
14
15 // Assign the original values to the product instance
16 product.ProductName = original_productName;
17 if (original_unitPrice == null) product.SetUnitPriceNull(); else product.UnitPrice = original_unitPrice.Value;
18
19 // Accept the changes
20 product.AcceptChanges();
21
22 // Assign the new values to the product instance
23 product.ProductName = productName;
24 if (unitPrice == null) product.SetUnitPriceNull(); else product.UnitPrice = unitPrice.Value;
25
26 // Update the product record
27 int rowsAffected = Adapter.Update(product);
28
29 // Return true if precisely one row was updated, otherwise false
30 return rowsAffected == 1;
31 }
ProductsOptimisticConcurrencyBLL 那里漏了上面这一段代码,UpdateProducts方法的重载(6个参数)。文章里没有写出来,自己补上~
感谢译者的辛勤劳动 :)
译文中的UpdateCommand事件处理的第11行代码
不是:
decimal unitPriceValue = null;
应该是:
decimal? unitPriceValue = null;
================================
感谢译者的辛勤劳动。
To txdlf:
红色表示在这个blog翻译的。
最近没有看这些,你能不能给个地址呢
红色代表什么意思呢~~
还有csdn把剩下的翻译了,能不能把连接加在后面呢~方便查阅
汗一个。。。。。。
原来自己在母版中把Content1的EnableViewState属性设置未false了。。。。
解决问题了。。。。。。。
感谢译者的辛勤劳动
照着上面做了。最后出来的是:
按了Category那里的linkbutton后,没有引发Categories_ItemBound 事件。
我在
protected void Categories_ItemCommand(object source, RepeaterCommandEventArgs e)
这里设置了断点,点了Linkbutton后没有进入断点。
用下载的代码也是一样。
究竟是为什么呢?
Blog主有空解答一下好吗。
Waiting for your reply。
THX
To Nicholas Yuen:
Many thanks :)
<asp:Repeater runat="server" ID="ProductsByCategoryList" EnableViewState="False"
DataSource='<%# GetProductsInCategory(CType(Eval("CategoryID"), Integer)) %>'>

</asp:Repeater>
这里C#的代码应该为
<asp:Repeater runat="server" ID="ProductsByCategoryList" EnableViewState="false" DataSource='<%# GetProductsInCategory((int)Eval("CategoryID")) %>'>
re: 每个人都有自己的困扰[未登录] dd 2007-09-01 12:05
edeeeeeeeeee
小弟请教高手!十万火急! 駜 2007-08-27 11:17
C# datalist可不可以一行只显示一个记录!如果可以请问怎么实现啊!谢谢!
re: 代友招人 迭戈 2007-08-21 08:35
你好。现在还招人吗?谢谢