摘要: 大家在使用.NET开发时把查询结果以DataTable返回很方便,但是在检索数据时又很麻烦,没有模型类型检索方便。 所以很多人都是按照以下方式做的: // 获得查询结果 DataTable dt = DbHelper.ExecuteDataTable(...); // 把DataTable转换为IList<UserInfo> IList<UserInfo> users = Co... 阅读全文
posted @ 2012-04-12 06:37 猫爷爷 阅读(771) 评论(0) 推荐(0) 编辑
摘要: 在弹出的提示面板中用ajax提交信息,返回的seccess值获取不到。 如下程序: //回复提交 function subReply() { var reply = $("#replyContent").val(); $.ajax({ type: "post", url: "/Handler/addRepl... 阅读全文
posted @ 2012-03-25 16:40 猫爷爷 阅读(381) 评论(1) 推荐(0) 编辑
摘要: windows.xaml<NavigationWindow x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" ShowsNavigationUI="False" Source="Index.x 阅读全文
posted @ 2012-03-24 18:38 猫爷爷 阅读(1258) 评论(1) 推荐(0) 编辑
摘要: Main.xaml <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!--TitlePanel 包含应用程序的名称和页标题--> <StackPanel x:Name=&quo 阅读全文
posted @ 2012-03-24 18:33 猫爷爷 阅读(1524) 评论(1) 推荐(0) 编辑
摘要: 前台:page.xaml<phone:PhoneApplicationPage x:Class="PhoneApp1.Page1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phon 阅读全文
posted @ 2012-03-24 18:29 猫爷爷 阅读(1485) 评论(0) 推荐(0) 编辑
摘要: System.Net.IPHostEntry IpEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); for (int i = 0; i != IpEntry.AddressList.Length; i++) { if (!IpEntry.AddressList[i].IsIPv6LinkLocal) { MessageBox.Show(IpEntry.AddressList[i].ToString()); } }在最后一行字符串不知道为什么获取... 阅读全文
posted @ 2012-03-24 18:04 猫爷爷 阅读(481) 评论(1) 推荐(0) 编辑
摘要: 刚开始接触jquery,很多东西不熟悉在用$("#id")来获得页面的input元素的时候,发现$("#id").value不能取到值后来终于在伟大的百度帮助下,找到了问题的原因:$("")是一个jquery对象,而不是一个dom elementvalue是dom element的属性jquery与之对应的是valval() :获得第一个匹配元素的当前值。val(val):设置每一个匹配元素的值。所以,代码应该这样写:取值:val = $("#id")[0].value;赋值:$("#id")[ 阅读全文
posted @ 2012-03-24 18:03 猫爷爷 阅读(1971) 评论(2) 推荐(0) 编辑
摘要: function isEmail(obj) { reg = /^\w{3,}@\w+(\.\w+)+$/; $("#emailSure").removeClass('imgSure'); if (!reg.test(obj)) { $("#emailSure").attr("src", "img/error.png"); } else { $("#emailSure").attr("src", "img/success.png"); } } 阅读全文
posted @ 2012-03-24 18:02 猫爷爷 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 连接数据库时加上 charset=utf8 如下: <connectionStrings> <add name="ClinicDB" connectionString="Data Source=localhost;User Id=root;Password=root;Database=Clinic;charset=utf8;"/> </connectionStrings> 阅读全文
posted @ 2012-03-24 18:01 猫爷爷 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 下载Dblinq-0.20.1编写批处理文件,放在Dblinq文件夹中,生成数据操作类。@echo offDbMetal.exe -provider="MySql" -conn="Data Source=localhost;port=3306;User Id=***;Password=***" -database="***" -namespace="***" -code="mysql\***.cs" -sprocs把生成的***.cs文件复制到项目中修改生成的代码:更改继承到DbLinq.MyS 阅读全文
posted @ 2012-03-24 18:00 猫爷爷 阅读(362) 评论(0) 推荐(1) 编辑