| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5851 人关注过本帖
标题:请教哪错了?
只看楼主 加入收藏
byp2011
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2011-6-7
结帖率:0
收藏
已结贴  问题点数:0 回复次数:5 
请教哪错了?
using System.Data.oracleClient;

namespace first
{
    public partial class login : System.Web.UI.Page
    {
        private void Page_Load(object sender, EventArgs e)
        {
            string userName = Request.Form["username"].ToString();
            string userPwd = Request.Form["userpwd"].ToString();
            oracleConnection con =new oracleConnection("Provider=MSDASQL.1;Password=zyytcy06;Persist Security Info=True;User ID=cy06dba;Data Source=cy06dba;");
            //string ConnectionString = "Data Source=cy6;user=cy06dba;password=zyytcy06;";//写连接串
            //OracleConnection conn = new OracleConnection(ConnectionString);//创建一个新连接
            con.open();
            //OracleCommand cmd = conn.CreateCommand();
          错误语句: OracleCommand cmd=new OracleCommand("select count(*) from dbausr where name='"+userName+"' and pwd='"+userPwd+"'",con);
            int count=Convert.Toint32(cmd.ExecuteScalar());
            if (count>0)
            {
            Response.Redirect("main.aspx");
            
            }
            else
            {
                Response.Redirect("loginFail.htm");

        }
    }
}
搜索更多相关主题的帖子: private public class first using 
2011-10-10 08:38
jalonlovesja
Rank: 5Rank: 5
来 自:湖南邵阳
等 级:职业侠客
帖 子:292
专家分:371
注 册:2008-2-19
收藏
得分:10 
把错误贴出来

小弟,身高1.60米,农村户口,小学文化,家有农田1亩.
2011-10-10 08:52
byp2011
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2011-6-7
收藏
得分:0 
回复 2楼 jalonlovesja
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误消息: CS1056: 意外的字符“(”

源错误:

 

行 26:             con.open();
行 27:             //OracleCommand cmd = conn.CreateCommand();
行 28:            OracleCommand cmd=new OracleCommand("select count(*) from dbausr where name='"+userName+"' and pwd='"+userPwd+"'",con);
行 29:             int count=Convert.Toint32(cmd.ExecuteScalar());
行 30:             if (count>0)
 

源文件: d:\weblx\first\first\login.aspx.cs    行: 28



显示详细的编译器输出:


C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE> "C:\Windows\\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\\Framework\v2.0.50727\mscorlib.dll" /R:"C:\Windows\\Framework\v2.0.50727\Temporary Files\root\4dc488b2\fef93ba9\assembly\dl3\23e70775\bf5bcc64_9585cc01\first.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /out:"C:\Windows\\Framework\v2.0.50727\Temporary Files\root\4dc488b2\fef93ba9\App_Web_6ejujxff.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\Windows\\Framework\v2.0.50727\Temporary Files\root\4dc488b2\fef93ba9\App_Web_6ejujxff.0.cs" "C:\Windows\\Framework\v2.0.50727\Temporary Files\root\4dc488b2\fef93ba9\App_Web_6ejujxff.1.cs" "C:\Windows\\Framework\v2.0.50727\Temporary Files\root\4dc488b2\fef93ba9\App_Web_6ejujxff.2.cs"


适用于 Microsoft(R) .NET Framework 3.5 版的 Microsoft(R) Visual C# 2008 编译器 3.5.30729.4926
 
版权所有(C) Microsoft Corporation。保留所有权利。

d:\weblx\first\first\login.aspx.cs(28,47): error CS1056: 意外的字符“(”
d:\weblx\first\first\login.aspx.cs(41,2): error CS1513: 应输入 }

 



显示完整的编译源:


行 1:    #pragma checksum "D:\weblx\first\first\login.aspx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "F4B8E412BE584B3D817B6FF912712F6D"
行 2:    //------------------------------------------------------------------------------
行 3:    // <auto-generated>
行 4:    //     此代码由工具生成。
行 5:    //     运行时版本:2.0.50727.4961
行 6:    //
行 7:    //     对此文件的更改可能会导致不正确的行为,并且如果
行 8:    //     重新生成代码,这些更改将会丢失。
行 9:    // </auto-generated>
行 10:   //------------------------------------------------------------------------------
行 11:   
行 12:   
行 13:   
行 14:   public partial class login : System.Web.SessionState.IRequiresSessionState {
行 15:      
行 16:      
行 17:       #line 11 "D:\weblx\first\first\login.aspx"
行 18:       protected global::System.Web.UI.HtmlControls.HtmlForm form1;
行 19:      
行 20:       #line default
行 21:       #line hidden
行 22:      
行 23:       protected System.Web.Profile.DefaultProfile Profile {
行 24:           get {
行 25:               return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
行 26:           }
行 27:       }
行 28:      
行 29:       protected System.Web.HttpApplication ApplicationInstance {
行 30:           get {
行 31:               return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
行 32:           }
行 33:       }
行 34:   }
行 35:   namespace ASP {
行 36:      
行 37:       #line 285 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 38:       using System.Web.Profile;
行 39:      
行 40:       #line default
行 41:       #line hidden
行 42:      
行 43:       #line 280 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 44:       using System.Text.RegularExpressions;
行 45:      
行 46:       #line default
行 47:       #line hidden
行 48:      
行 49:       #line 282 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 50:       using System.Web.Caching;
行 51:      
行 52:       #line default
行 53:       #line hidden
行 54:      
行 55:       #line 278 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 56:       using System.Configuration;
行 57:      
行 58:       #line default
行 59:       #line hidden
行 60:      
行 61:       #line 277 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 62:       using System.Collections.Specialized;
行 63:      
行 64:       #line default
行 65:       #line hidden
行 66:      
行 67:       #line 289 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 68:       using System.Web.UI.HtmlControls;
行 69:      
行 70:       #line default
行 71:       #line hidden
行 72:      
行 73:       #line 287 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 74:       using System.Web.UI.WebControls;
行 75:      
行 76:       #line default
行 77:       #line hidden
行 78:      
行 79:       #line 276 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 80:       using System.Collections;
行 81:      
行 82:       #line default
行 83:       #line hidden
行 84:      
行 85:       #line 286 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 86:       using System.Web.UI;
行 87:      
行 88:       #line default
行 89:       #line hidden
行 90:      
行 91:       #line 288 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 92:       using System.Web.UI.WebControls.WebParts;
行 93:      
行 94:       #line default
行 95:       #line hidden
行 96:      
行 97:       #line 275 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 98:       using System;
行 99:      
行 100:      #line default
行 101:      #line hidden
行 102:      
行 103:      #line 284 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 104:      using System.Web.Security;
行 105:      
行 106:      #line default
行 107:      #line hidden
行 108:      
行 109:      #line 281 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 110:      using System.Web;
行 111:      
行 112:      #line default
行 113:      #line hidden
行 114:      
行 115:      #line 283 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 116:      using System.Web.SessionState;
行 117:      
行 118:      #line default
行 119:      #line hidden
行 120:      
行 121:      #line 279 "C:\Windows\\Framework\v2.0.50727\Config\web.config"
行 122:      using System.Text;
行 123:      
行 124:      #line default
行 125:      #line hidden
行 126:      
行 127:      
行 128:      [System.()]
行 129:      public class login_aspx : global::login, System.Web.IHttpHandler {
行 130:         
行 131:          private static bool @__initialized;
行 132:         
行 133:          private static object @__fileDependencies;
行 134:         
行 135:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 136:          public login_aspx() {
行 137:              string[] dependencies;
行 138:              
行 139:              #line 912304 "D:\weblx\first\first\login.aspx.cs"
行 140:              ((global::System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/login.aspx";
行 141:              
行 142:              #line default
行 143:              #line hidden
行 144:              if ((global::ASP.login_aspx.@__initialized == false)) {
行 145:                  dependencies = new string[2];
行 146:                  dependencies[0] = "~/login.aspx";
行 147:                  dependencies[1] = "~/login.aspx.cs";
行 148:                  global::ASP.login_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
行 149:                  global::ASP.login_aspx.@__initialized = true;
行 150:              }
行 151:              this.Server.ScriptTimeout = 30000000;
行 152:          }
行 153:         
行 154:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 155:          private global::System.Web.UI.HtmlControls.HtmlTitle @__BuildControl__control3() {
行 156:              global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl;
行 157:              
行 158:              #line 8 "D:\weblx\first\first\login.aspx"
行 159:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlTitle();
行 160:              
行 161:              #line default
行 162:              #line hidden
行 163:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
行 164:              
行 165:              #line 8 "D:\weblx\first\first\login.aspx"
行 166:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("无标题页"));
行 167:              
行 168:              #line default
行 169:              #line hidden
行 170:              return @__ctrl;
行 171:          }
行 172:         
行 173:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 174:          private global::System.Web.UI.HtmlControls.HtmlHead @__BuildControl__control2() {
行 175:              global::System.Web.UI.HtmlControls.HtmlHead @__ctrl;
行 176:              
行 177:              #line 7 "D:\weblx\first\first\login.aspx"
行 178:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlHead("head");
行 179:              
行 180:              #line default
行 181:              #line hidden
行 182:              global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl1;
行 183:              
行 184:              #line 7 "D:\weblx\first\first\login.aspx"
行 185:              @__ctrl1 = this.@__BuildControl__control3();
行 186:              
行 187:              #line default
行 188:              #line hidden
行 189:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
行 190:              
行 191:              #line 7 "D:\weblx\first\first\login.aspx"
行 192:              @__parser.AddParsedSubObject(@__ctrl1);
行 193:              
行 194:              #line default
行 195:              #line hidden
行 196:              return @__ctrl;
行 197:          }
行 198:         
行 199:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 200:          private global::System.Web.UI.HtmlControls.HtmlForm @__BuildControlform1() {
行 201:              global::System.Web.UI.HtmlControls.HtmlForm @__ctrl;
行 202:              
行 203:              #line 11 "D:\weblx\first\first\login.aspx"
行 204:              @__ctrl = new global::System.Web.UI.HtmlControls.HtmlForm();
行 205:              
行 206:              #line default
行 207:              #line hidden
行 208:              this.form1 = @__ctrl;
行 209:              
行 210:              #line 11 "D:\weblx\first\first\login.aspx"
行 211:              @__ctrl.ID = "form1";
行 212:              
行 213:              #line default
行 214:              #line hidden
行 215:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
行 216:              
行 217:              #line 11 "D:\weblx\first\first\login.aspx"
行 218:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n    <div>\r\n    \r\n    </div>\r\n    "));
行 219:              
行 220:              #line default
行 221:              #line hidden
行 222:              return @__ctrl;
行 223:          }
行 224:         
行 225:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 226:          private void @__BuildControlTree(login_aspx @__ctrl) {
行 227:              
行 228:              #line 1 "D:\weblx\first\first\login.aspx"
行 229:              this.InitializeCulture();
行 230:              
行 231:              #line default
行 232:              #line hidden
行 233:              System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
行 234:              
行 235:              #line 1 "D:\weblx\first\first\login.aspx"
行 236:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w" +
行 237:                          "\">\r\n\r\n<html xmlns=\"http://www. +
行 238:                          "1999/xhtml\" >\r\n"));
行 239:              
行 240:              #line default
行 241:              #line hidden
行 242:              global::System.Web.UI.HtmlControls.HtmlHead @__ctrl1;
行 243:              
行 244:              #line 1 "D:\weblx\first\first\login.aspx"
行 245:              @__ctrl1 = this.@__BuildControl__control2();
行 246:              
行 247:              #line default
行 248:              #line hidden
行 249:              
行 250:              #line 1 "D:\weblx\first\first\login.aspx"
行 251:              @__parser.AddParsedSubObject(@__ctrl1);
行 252:              
行 253:              #line default
行 254:              #line hidden
行 255:              
行 256:              #line 1 "D:\weblx\first\first\login.aspx"
行 257:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n<body>\r\n    "));
行 258:              
行 259:              #line default
行 260:              #line hidden
行 261:              global::System.Web.UI.HtmlControls.HtmlForm @__ctrl2;
行 262:              
行 263:              #line 1 "D:\weblx\first\first\login.aspx"
行 264:              @__ctrl2 = this.@__BuildControlform1();
行 265:              
行 266:              #line default
行 267:              #line hidden
行 268:              
行 269:              #line 1 "D:\weblx\first\first\login.aspx"
行 270:              @__parser.AddParsedSubObject(@__ctrl2);
行 271:              
行 272:              #line default
行 273:              #line hidden
行 274:              
行 275:              #line 1 "D:\weblx\first\first\login.aspx"
行 276:              @__parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n    <p>\r\n        &nbsp;</p>\r\n</body>\r\n</html>\r\n"));
行 277:              
行 278:              #line default
行 279:              #line hidden
行 280:          }
行 281:         
行 282:         
行 283:          #line 912304 "D:\weblx\first\first\login.aspx.cs"
行 284:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 285:          protected override void FrameworkInitialize() {
行 286:              base.FrameworkInitialize();
行 287:              this.@__BuildControlTree(this);
行 288:              this.AddWrappedFileDependencies(global::ASP.login_aspx.@__fileDependencies);
行 289:              this.Request.ValidateInput();
行 290:          }
行 291:         
行 292:          #line default
行 293:          #line hidden
行 294:         
行 295:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 296:          public override int GetTypeHashCode() {
行 297:              return 783430533;
行 298:          }
行 299:         
行 300:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
行 301:          public override void ProcessRequest(System.Web.HttpContext context) {
行 302:              base.ProcessRequest(context);
行 303:          }
行 304:      }
行 305:  }
行 306:  
 




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.4961; 版本:2.0.50727.4955
2011-10-10 08:57
jalonlovesja
Rank: 5Rank: 5
来 自:湖南邵阳
等 级:职业侠客
帖 子:292
专家分:371
注 册:2008-2-19
收藏
得分:0 
把你输入法切换一下,试试

小弟,身高1.60米,农村户口,小学文化,家有农田1亩.
2011-10-10 09:19
jalonlovesja
Rank: 5Rank: 5
来 自:湖南邵阳
等 级:职业侠客
帖 子:292
专家分:371
注 册:2008-2-19
收藏
得分:0 
改这个"("

小弟,身高1.60米,农村户口,小学文化,家有农田1亩.
2011-10-10 09:20
dotnetcode
Rank: 2
等 级:论坛游民
帖 子:30
专家分:78
注 册:2011-9-8
收藏
得分:10 
有结果了吗

[url=http://www.]中国乡卫网[/url]
2011-10-17 15:48
快速回复:请教哪错了?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031917 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved