类型不匹配:不能从 Integer 转换为 int

<%
//隐式对象,系统对象 jsp简化程序员的工作,已经建好的对象
//servletContext对象 net application
//当前在线人数
int num = (Integer)application.getAttribute("usernum");

 num++;
 application.setAttribute("usernum",new Integer(num));




 %>

4个回答

int num = ((Integer)application.getAttribute("usernum")).intValue();

application.getAttribute("usernum")..intValue();
或者用 Integer 而不是 int 接收。

Integer 和 int 是不同的,前者的type 是 object,后者是primitive (基本类型)。
这两者是没有隐式类型转换的
Integer to int, 用xxx.intValue()

类型 ServletContext 中的方法 setAttribute(String, Object)对于参数(String, int)不
适用

package com.control;

import javax.servlet.ServletContextEvent;

public class ApplicationListener implements javax.servlet.ServletContextListener{

public void contextDestroyed(ServletContextEvent arg0) {
// TODO 自动生成方法存根

System.out.println("contextDestroyed");
}

// application start
public void contextInitialized(ServletContextEvent arg0) {
// TODO 自动生成方法存根
System.out.println("contextInitialized");
arg0.getServletContext().setAttribute("usernum",0 );

}

}

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
不能从Integer转换为Int
int num=Integer.valueOf(request.getParameter("hiddenNum"));rn显示出错,不能从Integer转换为Int,该怎么改?
类型不匹配:不能从 String 转换为 Enumeration
[code=Java]Enumeration en_head_value =request.getHeader("cookie");//就是这句有错即下面的line:30(en_head_value.hasMoreElements()) rnString s = (String)en_head_value.nextElement();rnout.println(s);rn[/code]rnAn error occurred at line: 30 in the jsp file: /requestExample.jsprnType mismatch: cannot convert from String to Enumerationrn类型不匹配:不能从 String 转换为 Enumerationrn我试了,强制转换也没有用,请高手帮我看一下,该怎么改?为什么要这么改?rn
错误:类型不匹配:不能从 Cookie[] 转换为 Cookie[]
HttpClient c = new HttpClient();rnCookie[] cookies = c.getState().getCookies();rn提示错误,类型不匹配:不能从 Cookie[] 转换为 Cookie[]
类型不匹配:不能从 String 转换为 String
public class Str rnrn /**rn * @param argsrn */rn public static void main(String[] args) rn // TODO Auto-generated method stubrnrn String s1="First String";rn String s2="Second String";rn rn String s3=s1;rn rn System.out.println("Length of strob1:"+(s1.length());rn System.out.println("Char at index 3 in strob1:"+(s1.charAt(3));rn rn if (s1.equals(s2))rn System.out.println("strob1==strob2");rn elsern System.out.println("strob1!=strob2");rn if (s1.equals(s3))rn System.out.println("strob1==strob3");rn elsern System.out.println("strob1!=strob3");rnrnrn rnrnrn
java问题: 类型不匹配:不能从元素类型 Object 转换为 String
在Eclipse里输入以下代码报错 不能从元素类型 Object 转换为 String:(红色部分为报错的代码)rnrnpackage com.android.signapk;rnrnimport java.io.BufferedReader;rnimport java.io.ByteArrayOutputStream;rnimport java.io.DataInputStream;rnimport java.io.File;rnimport java.io.FileInputStream;rnimport java.io.FileOutputStream;rnimport java.io.FilterOutputStream;rnimport java.io.IOException;rnimport java.io.InputStream;rnimport java.io.InputStreamReader;rnimport java.io.OutputStream;rnimport java.io.PrintStream;rnimport java.security.DigestOutputStream;rnimport java.security.GeneralSecurityException;rnimport java.security.Key;rnimport java.security.KeyFactory;rnimport java.security.MessageDigest;rnimport java.security.PrivateKey;rnimport java.security.Signature;rnimport java.security.SignatureException;rnimport java.security.cert.CertificateFactory;rnimport java.security.cert.X509Certificate;rnimport java.security.spec.InvalidKeySpecException;rnimport java.security.spec.KeySpec;rnimport java.security.spec.PKCS8EncodedKeySpec;rnimport java.util.Enumeration;rnimport java.util.Map;rnimport java.util.Map.Entry;rnimport java.util.jar.Attributes;rnimport java.util.jar.JarEntry;rnimport java.util.jar.JarFile;rnimport java.util.jar.JarOutputStream;rnimport java.util.jar.Manifest;rnrnimport javax.crypto.Cipher;rnimport javax.crypto.EncryptedPrivateKeyInfo;rnimport javax.crypto.SecretKeyFactory;rnimport javax.crypto.spec.PBEKeySpec;rnimport javax.security.auth.x500.X500Principal;rnrnimport sun.misc.BASE64Encoder;rnimport sun.security.pkcs.ContentInfo;rnimport sun.security.pkcs.PKCS7;rnimport sun.security.pkcs.SignerInfo;rnimport sun.security.x509.AlgorithmId;rnimport sun.security.x509.X500Name;rnrnclass SignApkrnrn private static X509Certificate readPublicKey(File file)rn throws IOException, GeneralSecurityExceptionrn rn FileInputStream input = new FileInputStream(file);rn try rn CertificateFactory cf = CertificateFactory.getInstance("X.509");rn return (X509Certificate)cf.generateCertificate(input);rn finally rn input.close();rn rn rnrn private static String readPassword(File keyFile)rn rn System.out.print("Enter password for " + keyFile + " (password will not be hidden): ");rn System.out.flush();rn BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));rn try rn return stdin.readLine(); catch (IOException ex) rn rn return null;rn rnrn private static KeySpec decryptPrivateKey(byte[] encryptedPrivateKey, File keyFile)rn throws GeneralSecurityExceptionrn rn EncryptedPrivateKeyInfo epkInfo;rn tryrn rn epkInfo = new EncryptedPrivateKeyInfo(encryptedPrivateKey);rn rn catch (IOException ex) rn return null;rn rnrn char[] password = readPassword(keyFile).toCharArray();rnrn SecretKeyFactory skFactory = SecretKeyFactory.getInstance(epkInfo.getAlgName());rn Key key = skFactory.generateSecret(new PBEKeySpec(password));rnrn Cipher cipher = Cipher.getInstance(epkInfo.getAlgName());rn cipher.init(2, key, epkInfo.getAlgParameters());rn tryrn rn return epkInfo.getKeySpec(cipher);rn catch (InvalidKeySpecException ex) rn System.err.println("signapk: Password for " + keyFile + " may be bad.");rn throw ex;rn rn rnrn private static PrivateKey readPrivateKey(File file)rn throws IOException, GeneralSecurityExceptionrn rn DataInputStream input = new DataInputStream(new FileInputStream(file));rn try rn byte[] bytes = new byte[(int)file.length()];rn input.read(bytes);rnrn KeySpec spec = decryptPrivateKey(bytes, file);rn if (spec == null) rn spec = new PKCS8EncodedKeySpec(bytes);rn rn tryrn rn return KeyFactory.getInstance("RSA").generatePrivate(spec);rn catch (InvalidKeySpecException ex) rn return KeyFactory.getInstance("DSA").generatePrivate(spec);rn rn finally rn input.close();rn rn rnrn private static Manifest addDigestsToManifest(JarFile jar)rn throws IOException, GeneralSecurityExceptionrn rn Manifest input = jar.getManifest();rn Manifest output = new Manifest();rn Attributes main = output.getMainAttributes();rn if (input != null) rn main.putAll(input.getMainAttributes());rn else rn main.putValue("Manifest-Version", "1.0");rn main.putValue("Created-By", "1.7 (Zengge)");rn rnrn BASE64Encoder base64 = new BASE64Encoder();rn MessageDigest md = MessageDigest.getInstance("SHA1");rn byte[] buffer = new byte[4096];rnrn for (Enumeration e = jar.entries(); e.hasMoreElements(); ) rn JarEntry entry = (JarEntry)e.nextElement();rn String name = entry.getName();rn if ((!entry.isDirectory()) && (!name.equals("META-INF/MANIFEST.MF"))) rn InputStream data = jar.getInputStream(entry);rn int num;rn while ((num = data.read(buffer)) > 0) rn md.update(buffer, 0, num);rn rnrn Attributes attr = null;rn if (input != null) attr = input.getAttributes(name);rn attr = attr != null ? new Attributes(attr) : new Attributes();rn attr.putValue("SHA1-Digest", base64.encode(md.digest()));rn output.getEntries().put(name, attr);rn rn rnrn return output;rn rnrn private static void writeSignatureFile(Manifest manifest, OutputStream out)rn throws IOException, GeneralSecurityExceptionrn rn Manifest sf = new Manifest();rn Attributes main = sf.getMainAttributes();rn main.putValue("Signature-Version", "1.0");rn main.putValue("Created-By", "1.0 (Android SignApk)");rnrn BASE64Encoder base64 = new BASE64Encoder();rn MessageDigest md = MessageDigest.getInstance("SHA1");rn PrintStream print = new PrintStream(new DigestOutputStream(new ByteArrayOutputStream(), md), true, "UTF-8");rnrn manifest.write(print);rn print.flush();rn main.putValue("SHA1-Digest-Manifest", base64.encode(md.digest()));rnrn Map entries = manifest.getEntries();rn for (Map.Entry entry : [color=#FF0000]entries.entrySet()[/color])rn rn print.print("Name: " + (String)entry.getKey() + "\r\n");rn for (Map.Entry att : ((Attributes)entry.getValue()).entrySet()) rn print.print(att.getKey() + ": " + att.getValue() + "\r\n");rn rn print.print("\r\n");rn print.flush();rnrn Attributes sfAttr = new Attributes();rn sfAttr.putValue("SHA1-Digest", base64.encode(md.digest()));rn sf.getEntries().put((String) entry.getKey(), sfAttr);rn rnrn sf.write(out);rn rnrn private static void writeSignatureBlock(Signature signature, X509Certificate publicKey, OutputStream out)rn throws IOException, GeneralSecurityExceptionrn rn SignerInfo signerInfo = new SignerInfo(new X500Name(publicKey.getIssuerX500Principal().getName()), publicKey.getSerialNumber(), AlgorithmId.get("SHA1"), AlgorithmId.get("RSA"), signature.sign());rnrn PKCS7 pkcs7 = new PKCS7(new AlgorithmId[] AlgorithmId.get("SHA1") , new ContentInfo(ContentInfo.DATA_OID, null), new X509Certificate[] publicKey , new SignerInfo[] signerInfo );rnrn pkcs7.encodeSignedData(out);rn rnrn private static void copyFiles(Manifest manifest, JarFile in, JarOutputStream out)rn throws IOExceptionrn rn byte[] buffer = new byte[4096];rnrn Map entries = manifest.getEntries();rn for (String name : [color=#FF0000]entries.keySet()[/color]) rn JarEntry inEntry = in.getJarEntry(name);rn if (inEntry.getMethod() == 0)rn rn out.putNextEntry(new JarEntry(inEntry));rn rn else rn out.putNextEntry(new JarEntry(name));rn rnrn InputStream data = in.getInputStream(inEntry);rn int num;rn while ((num = data.read(buffer)) > 0) rn out.write(buffer, 0, num);rn rn out.flush();rn rn rnrn public static void main(String[] args) rn if (args.length != 4) rn System.err.println("用法: java -jar zgsign.jar .x509[.pem] .pk8 .jar .jar");rnrn System.exit(2);rn rnrn JarFile inputJar = null;rn JarOutputStream outputJar = null;rn tryrn rn X509Certificate publicKey = readPublicKey(new File(args[0]));rn PrivateKey privateKey = readPrivateKey(new File(args[1]));rn inputJar = new JarFile(new File(args[2]), false);rn outputJar = new JarOutputStream(new FileOutputStream(args[3]));rn outputJar.setLevel(9);rnrn Manifest manifest = addDigestsToManifest(inputJar);rn manifest.getEntries().remove("META-INF/*.SF");rn manifest.getEntries().remove("META-INF/*.RSA");rn outputJar.putNextEntry(new JarEntry("META-INF/MANIFEST.MF"));rn manifest.write(outputJar);rnrn Signature signature = Signature.getInstance("SHA1withRSA");rn signature.initSign(privateKey);rn outputJar.putNextEntry(new JarEntry("META-INF/ZENGGE.SF"));rn writeSignatureFile(manifest, new SignatureOutputStream(outputJar, signature));rnrn outputJar.putNextEntry(new JarEntry("META-INF/ZENGGE.RSA"));rn writeSignatureBlock(signature, publicKey, outputJar);rnrn copyFiles(manifest, inputJar, outputJar);rn catch (Exception e) rn e.printStackTrace();rn System.exit(1);rn finally rn try rn if (inputJar != null) inputJar.close();rn if (outputJar != null) outputJar.close(); rn rn catch (IOException e) e.printStackTrace();rn System.exit(1);rn rn rn rnrn private static class SignatureOutputStream extends FilterOutputStreamrn rn private Signature mSignature;rnrn public SignatureOutputStream(OutputStream out, Signature sig)rn rn super(out);rn mSignature = sig;rn rnrn public void write(int b) throws IOExceptionrn rn try rn mSignature.update((byte)b);rn catch (SignatureException e) rn throw new IOException("SignatureException: " + e);rn rn super.write(b);rn rnrn public void write(byte[] b, int off, int len) throws IOExceptionrn rn try rn mSignature.update(b, off, len);rn catch (SignatureException e) rn throw new IOException("SignatureException: " + e);rn rn super.write(b, off, len);rn rn rnrnrn请问怎么修改
不能从 Connection 转换为 Connection
[code=Java]rnimport java.beans.Statement;rnimport com.sun.corba.se.pept.transport.Connection;rnimport java.sql.*;rnrnpublic class aarn public static void main(String[] args)rn try rn Class.forName("com.mysql.jdbc.Driver");rn catch (ClassNotFoundException e) rn // TODO 自动生成 catch 块rn e.printStackTrace();rn rn try rn Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/guestbook", "root","123");rn catch (SQLException e) rn // TODO 自动生成 catch 块rn e.printStackTrace();rn rn try rn // Statement st = con.rn // ResultSet rs = st. rn // //ResultSet rs = stmt.execute("select * from messges");rn catch (SQLException e) rn // TODO 自动生成 catch 块rn e.printStackTrace();rn rn rnrn[/code]rnrnConnection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/guestbook", "root","123");rn 这句提示类型不匹配:不能从 Connection 转换为 Connection 怎么回事的?rnrn还有,实例化了Statement 到st上.它却找不到executeQuery()这个方法...rnrnrnrnrn
转换为int类型
本职业规划路线是专门为从事运维开发的同学准备的,并且是严格按照企业需求的标准定制的学习路线。路线中包含python基础和进阶,linux基础和进阶,前端,MySQL,Django框架,以及ansible,实战开发自动化运维平台,实现全栈开发!
System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。
System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。    在 System.DBNull.System.IConvertible.ToDouble(IFormatProvider provider)    在 System.Convert.ToDouble(Object value) .... System.InvalidCastExcep
对象不能从DBNull转换为其他类型
rn if (!row.IsNull("UpdateDate"))rn rn pn.UpdateDate = (DateTime)(row["UpdateDate"]);rn rn总是报“对象不能从DBNull转换为其他类型”rn麻烦大家帮忙看看哪儿有问题
C# 对象不能从 DBNull 转换为其他类型
foreach (DataRow dr in dtData.Rows) //遍历行 in 行的集合rn rn byte[] EDS = new byte[183];rn EDS[0] = 0x82; // emm table idrn EDS[1] = 0x40; // rn EDS[2] = 0x3f;rn EDS[3] = 0x02;// emm secton lengthrn byte[] groupid = HexStrToHexBytes(dr["Group_name"].ToString());rn EDS[4] = groupid[0];rn EDS[5] = groupid[1];rn // emm secton lengthrn //发送emmrnrn rn rn string strConn = "Data Source=127.0.0.1;Initial Catalog=yz;User ID=sa;Password=sa123456";rn SqlConnection ConnAcc = new SqlConnection(strConn);rn string strSQL = "SELECT SGK FROM Group_SGK3 ";rn SqlDataAdapter de = new SqlDataAdapter(strSQL, ConnMdb);rn tryrn rn //da.Fill(dt);rn dtData.Clear();rn de.Fill(dtData);rn rn catchrn rn break;rn rnrn for (int n = 0; n < 7; n++)rn rn int GK;rn foreach (DataRow rdr in dtData.Rows)rn rnrn int SGK = Convert.ToInt32(rdr["SGK"]);rn GK = SGK << n;rnrn rn if (Convert.ToBoolean(rdr["state1"]))rn rn rnrn byte[] gk = new byte[8];rn Array.Copy(HexStrToHexBytes(GK.ToString()), 0, gk, 7, 1);rn rn ;rn SKeyValue = SKeyValue1;rn byte[] EncryptSk = EncryptDES(SKeyValue, gk);rn rnrn EDS[6] = 0x01;rn Array.Copy(EncryptSk, 0, EDS, 7, EncryptSk.Length);rn //Thread.Sleep(5);rn rn elsern rnrnrn rn EDS[6] = 0x01;rnrnrnrnrn rn EDS[7] = 0xff;rn EDS[8] = 0xff;rn for (int i = 9; i < 15; i++)rn rn EDS[i] = 0x00;rnrn rnrn rnrnrnrnif (Convert.ToBoolean(rdr["state1"]))这句话出错说“对象不能从 DBNull 转换为其他类型”,可是我的数据库不是空的呀,这是怎么回事?请高人指点!
急求助:对象不能从 DBNull 转换为其他类型。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。rnrn源错误: rnrnrn行 225:rn行 226: // TempStr += ""; rn行 227: if (showtime > 0) TempStr += "" + Convert.ToDateTime(dt.Rows[i]["ApprovalTime"]).ToString("M.d"); rn行 228: // if (hit > 0) TempStr += "[" + dt.Rows[i]["Hits"].ToString() + "]"; rn行 229: // if (ShowTime >0) TempStr += "[" + Convert.ToDateTime(dt.Rows[i][5].ToString()).Month + "." + Convert.ToDateTime(dt.Rows[i][5].ToString()).Day + "]";rn rnrn源文件: d:\新劳教局\template\NewsList.ascx.cs 行: 227 rnrn堆栈跟踪: rnrnrn[InvalidCastException: 对象不能从 DBNull 转换为其他类型。]rn System.DBNull.System.IConvertible.ToDateTime(IFormatProvider provider) +54rn System.Convert.ToDateTime(Object value) +29rn template_NewsList.txtList(DataTable dt) in d:\新劳教局\template\NewsList.ascx.cs:227rn template_NewsList.Page_Load(Object sender, EventArgs e) in d:\新劳教局\template\NewsList.ascx.cs:181rn System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15rn System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34rn System.Web.UI.Control.OnLoad(EventArgs e) +99rn System.Web.UI.Control.LoadRecursive() +47rn System.Web.UI.Control.LoadRecursive() +131rn System.Web.UI.Control.LoadRecursive() +131rn System.Web.UI.Control.LoadRecursive() +131rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061rnrn 请问这是什么原因?怎么修改啊rn谢谢了rn
关于错误“对象不能从 DBNull 转换为其他类型”
对象不能从 DBNull 转换为其他类型。 对于可用类型hit: newsModel.hit = Convert.ToInt64(reader[6]); 此句会导致错误。 修正: 先判断是否为空 newsModel.hit=reader[6]==DBNull.Value?0:Convert.ToInt64(reader[6]);
对象不能从 DBNull 转换为其他类型
对象不能从 DBNull 转换为其他类型。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。rnrn源错误: rnrnrn行 75: while (dr.Read()) rn行 76: rn行 77: sum += Convert.ToDecimal(dr["Proweight"]);rn行 78: rn行 79: return sum;rn rnrn源文件: d:\Ok.aspx.cs 行: 77 rnrnrn怎么解决啊,以前用的是access数据库 现在转换为SQL rn下面是以前的代码:rn while (dr.Read()) rn rn sum += Convert.ToDouble(dr["Proweight"]);rn rn return sum;rn现在总提示出错,苦于知识贫乏,还请大家帮忙了
对象不能从 DBNull 转换为其他类型。
对象不能从 DBNull 转换为其他类型。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。rnrn源错误: rnrnrn行 124: rn行 125: rn行 126: rn行 127: rn行 128: rn rn rn报错原因是查询结果没有数据,求解:当查询结果没有数据时,如何不报错???
弹出异常“对象不能从 DBNull 转换为其他类型。”
[b]数据库存储的值是null,不知道为什么程序跳到了else语句,还有弹出异常“对象不能从 DBNull 转换为其他类型。”rnrn请问一下是不是不可以这样判断的阿!有哪位仁兄可以帮帮忙[/b]rnrn[code=C#]rn if (dt.Rows[0]["ysgh"]==null)rn rn ck.Ysgh = null;rn ck.Yssj = null;rn ck.Ysip = null;rn rn elsern rn ck.Ysgh = Convert.ToInt32(dt.Rows[0]["ysgh"]);rn ck.Yssj = dt.Rows[0]["yssj"].ToString();rn ck.Ysip = dt.Rows[0]["ysip"].ToString();rn rn[/code]
有关对象不能从 DBNull 转换为其他类型问题
我想做网上购物系统,但运行就出现这种错误,请各位兄弟是什么原因rnrnrn源错误: rnrnrn行 118: rn行 119: DataRow r = dt.NewRow();rn行 120: r[0] = Convert.ToInt32(ds1.Tables[0].Rows[i]["ID"]);rn行 121: r[1] = ds1.Tables[0].Rows[i]["Sort"].ToString();rn行 122: r[2] = Convert.ToInt32(ds1.Tables[0].Rows[i]["ProductID"]);rn rnrn源文件: c:\inetpub\wwwroot\webapplicationdlh21\wsgw\gouwuche.aspx.cs 行: 120 rnrn堆栈跟踪: rnrnrn[InvalidCastException: 对象不能从 DBNull 转换为其他类型。]rn System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) +48rn System.Convert.ToInt32(Object value) +36rn WebApplicationDlh21.Wsgw.Gouwuche.dtBind() in c:\inetpub\wwwroot\webapplicationdlh21\wsgw\gouwuche.aspx.cs:120rn WebApplicationDlh21.Wsgw.Gouwuche.dgGouwucheBind() in c:\inetpub\wwwroot\webapplicationdlh21\wsgw\gouwuche.aspx.cs:100rn WebApplicationDlh21.Wsgw.Gouwuche.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplicationdlh21\wsgw\gouwuche.aspx.cs:65rn System.Web.UI.Control.OnLoad(EventArgs e) +67rn System.Web.UI.Control.LoadRecursive() +35rn System.Web.UI.Page.ProcessRequestMain() +731rnrn rnrn
Additional information: 对象不能从 DBNull 转换为其他类型。
[code=csharp]rn public static T DataRowToT(DataRow source) where T : class,new()rn rn T item = null;rn if (source == null)rn rn return item;rn rn item = new T();rn Type targettype = typeof(T);rn Type ptype = null;rn Object value = null;rn foreach (PropertyInfo pi in targettype.GetProperties())rn rn if (pi.CanWrite && source.Table.Columns.Contains(pi.Name))rn rn ptype = Type.GetType(pi.PropertyType.FullName);rn if (!(pi.PropertyType.FullName == "System.Byte[]" && source[pi.Name] == System.DBNull.Value))rn rn value = Convert.ChangeType(source[pi.Name], ptype);rn pi.SetValue(item, value, null);rnrn rnrn rn rn return item;rn [img=https://img-bbs.csdn.net/upload/201801/03/1514958991_852371.png][/img]rn[/code]
对象不能从 DBNull 转换为其他类型(c#中)
我想把access留言本转成SQL版的,结果出现如上问题,暴错71行,代码如下:rnusing System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnusing System.Data.SqlClient;rnusing System.Configuration;rnnamespace baogelybrnrn /// rn /// showguestbook 的摘要说明。rn /// rn public class showguestbook : System.Web.UI.Pagern rn protected System.Web.UI.WebControls.DataList DataList1;rn protected System.Web.UI.WebControls.Label Label1;rn protected System.Web.UI.WebControls.Label Label2;rn protected System.Web.UI.WebControls.Label Label3;rn protected System.Web.UI.WebControls.Button Button3;rn protected System.Web.UI.WebControls.Button Button1;rn protected System.Web.UI.WebControls.Button Button2;rn protected System.Web.UI.WebControls.Button Button4;rn protected System.Web.UI.WebControls.TextBox TextBox1;rn protected System.Web.UI.WebControls.Button Button5;rn rn private void Page_Load(object sender, System.EventArgs e)rn rn if(!this.IsPostBack)rn rn this.Label2.Text="1";rn this.databind();rn this.TextBox1.Text="1";rn rn rnrnrnrn public string ShowReply(bool IsReplyed, string replytime, string replycontent)rn rn if (!IsReplyed)rn rn return "";rn rn elsern rn return " 管理员于 '"+replytime+"' 回复 '"+replycontent.Replace("\r\n"," ")+"";rn rn rn private void databind()rn rn // int CID=Convert.ToInt32(Request.QueryString["id"]);rn int curPage=Convert.ToInt32(this.Label2.Text);rn// string dbPath=System.Configuration.ConfigurationSettings.AppSettings["lyb"];rn// //定义连接字符串rn// string ConnStr="Provider=Microsoft.Jet.Sql.4.0;Data Source="+Server.MapPath(dbPath);rn //创建数据库对像rn// SqlConnection connection=new SqlConnection(ConnStr);rn SqlConnection connection=db.createconnection();rnrn// String mysql="SELECT * FROM lyb order by id desc";rn // String mysql="SELECT * FROM Article where ispic=true order by ArticleID desc";rn SqlDataAdapter sda=new SqlDataAdapter();rn rn sda.SelectCommand=new SqlCommand("select * from lyb",connection);rn DataSet ds=new DataSet();rn sda.Fill(ds,"lyb");rn System.Web.UI.WebControls.PagedDataSource ps=new PagedDataSource();rn ps.DataSource=ds.Tables["lyb"].DefaultView;rn ps.AllowPaging=true;rn ps.PageSize=5;rn ps.CurrentPageIndex=curPage-1;rn this.Button1.Enabled=true;rn this.Button2.Enabled=true;rn rn if(curPage==1)rn rn this.Button1.Enabled=false;rn rn if(curPage==ps.PageCount)rn rn this.Button2.Enabled=false;rn rn rn rn this.DataList1.DataSource=ps;rn this.DataList1.DataBind();rn this.Label3.Text=Convert.ToString(ps.PageCount);rn rnrn #region Web 窗体设计器生成的代码rn override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Button3.Click += new System.EventHandler(this.Button3_Click);rn this.Button1.Click += new System.EventHandler(this.Button1_Click);rn this.Button2.Click += new System.EventHandler(this.Button2_Click);rn this.Button4.Click += new System.EventHandler(this.Button4_Click);rn this.Button5.Click += new System.EventHandler(this.Button5_Click);rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrnrn private void Button1_Click(object sender, System.EventArgs e)rn rn this.Label2.Text=Convert.ToString(Convert.ToInt32(this.Label2.Text)-1);rn this.databind();rn rnrn private void Button2_Click(object sender, System.EventArgs e)rn rn this.Label2.Text=Convert.ToString(Convert.ToInt32(this.Label2.Text)+1);rn this.databind();rn rnrn private void Button3_Click(object sender, System.EventArgs e)rn rn this.Label2.Text="1";rn this.databind();rn rnrn private void Button4_Click(object sender, System.EventArgs e)rn rn this.Label2.Text=Convert.ToString(Convert.ToInt32(this.Label3.Text));rn this.databind();rn rnrn private void Button5_Click(object sender, System.EventArgs e)rn rn if(this.TextBox1.Text.ToString()=="0")rn rn this.Label2.Text="1";rn this.databind();rn rn else if(this.TextBox1.Text.ToString()=="")rn rn this.Label2.Text="1";rn this.databind();rn rn rn elsern rn this.Label2.Text=Convert.ToString(this.TextBox1.Text);rn this.databind();rn rn rn rnrn
System.InvalidCastException: 对象不能从 DBNull 转换为其他类型
这是什么错误?
对象不能从 DBNull 转换为其他类型。 在线等
“/”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn对象不能从 DBNull 转换为其他类型。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.InvalidCastException: 对象不能从 DBNull 转换为其他类型。rnrn源错误: rnrnrn行 24: else rn行 25: rn行 26: if (Convert.ToInt32(obj) > 0)rn行 27: rn行 28: result = obj.ToString();rn rn 代码:rn public string Getjingsuchengdui(string name, int yue)rn rn string result = "";rnrn string str = " select CAST (SUM(Money) as decimal) from SCM_TransFunds,SCM_TransFunds4 where SCM_TransFunds.BillID=SCM_TransFunds4.BillID and DealerID=(select ID from CP_DLR where [name]='" + name + "') and jiesuanleixing=1 and BillDate>dateadd(mm," + -yue + ",getdate()) ";rnrn object obj = SqlHelper.ExecuteScalar(SqlHelper.jiangsu, CommandType.Text, str);rn if (obj == null)rn rn return "0";rnrn rn else rn rn if (Convert.ToInt32(obj) > 0)rn rn result = obj.ToString();rn rn return result;rn rnrn rn可以在线回答也可以加我qq99265117
从数据库读取数据后,为什么不能从_variant_t 转换为int,而只能转换为short?
short m_UserType = (short)((m_AdoConn.m_pRecordset)->Fields->GetItem(_variant_t("User_Type"))->Value);这句话可以通过编译但下面的就不行:rn int iType = (int)((m_AdoConn.m_pRecordset)->Fields->GetItem(_variant_t("User_Type"))->Value);这句话不能通过编译,老是提示:cannot convert from 'class _variant_t' to 'int'rnrn数据库中,User_Type 字段为 tinyint类型;rnrn初学VC,对VC的数据结构不甚了解,希望得到指点
String转换为int类型
在java中使用 Integer.parseInt在js中使用parseInt
JSP中如何将Integer转换为Int类型
JSP中如何将Integer转换为Int类型
不兼容的类型: int无法转换为int[]
[img=https://img-bbs.csdn.net/upload/201801/09/1515507583_319784.png][/img][code=java][img=https://img-bbs.csdn.net/upload/201801/09/1515507539_353764.png][/img][/code]
类型不匹配: 'mappath'
rn<%rnDim UnitNamernUnitName=request("UnitName")rnrnresponse.Write" "&UnitName&" "rnsql="select * from Connection where UnitName='"&UnitName&"'" rnset rs=server.createobject("adodb.recordset")rnrs.open sql,conn,1,1rn'address=rs("connString")rnrnSet conn1 = Server.CreateObject("ADODB.Connection")rnDBPath="DRIVER=Microsoft Access Driver (*.mdb);DBQ="&server.mappath(rs("connString")) rnconn1.Open DBPath rn%>rn报错:类型不匹配: 'mappath'请教各位大侠,谢谢。
类型不匹配
typedef struct nodern Item item;rn struct node * next;rn Node;rnrntypedef Node * List;rnrnList movies;rnrnListIsEmpty(&movies);rnrnbool ListIsEmpty(const List *); rnrn函数调用正常;rnrn但如果将 typedef Node * List 换成 tepydef Node List;rnrn定义 List *movies;rnrn然后调用 ListIsEmpty(&movies);rnrn编译器警告 类型不一致;rnrn这是 为什么;
类型不匹配?
<%rn rn set cn = Server.CreateObject("ADODB.Connection")rn cn.Open "driver=Microsoft Access Driver (*.mdb);dbq="("C:\Inetpub\wwwroot\test.mdb") rn set rs =cn.Execute("yhxx")rn for i=0 to rs.Fields.count-1rn Response.Write rs.Fields(i).Namern Response.Write rs.Fiedls(i).Valuern Nextrn %>rnrn为什么访问的时候会提示 cn类型不匹配?rn
类型不匹配的问题
我问addnew向数据库插入记录rntextfield里输的是数字,数据库字段类型设的是数字--整型rn我用rs1=trim(request.form("textfield"))rn rs("字段名")=rs1rn在执行到rs("字段名")=rs1时总报类型不匹配,这是为什么呢?(字段名是数字应该没关系吧)
类型不匹配的错误
一段加密的代码:明明时相同的类型,却总是显示“类型不匹配”的错误提示,为什么呢,真不懂,错误行时红色代码,而且运行时查看时StrTem和ChrTem都是字符,怎么会是类型不匹配呢,请指教?rnOption ExplicitrnrnDim x As SinglernDim Chr As String * 1 '表示文件中的一个字节rnDim i As IntegerrnDim j As IntegerrnDim StrTem As String * 1rnDim ChrTem As String * 1 '加密时使用的临时字符rnDim ChrPassWord As String * 1 ' 表示密码中的一个字符rnPublic Sub EncryptDecipher(FilePath As String, password As String)rnrnOpen FilePath For Binary As #1rnFor j = 1 To FileLen(FilePath)rn Get #1, j, Chrrn ChrTem = Chrrn For i = 1 To Len(password)rn ChrPassWord = Mid(password, i, 1)rn StrTem = ChrPassWordrn [color=#FF0000]ChrTem = StrTem Xor ChrTem[/color] rnNext irn Chr = ChrTemrn Put #1, , ChrrnNext jrnEnd Subrn
为什么类型不匹配??
Private Sub Command1_Click()rn Call Picture1.PaintPicture("c:\PLAYER.BMP", 0, 0, 12, 12)rnEnd Subrn
类型不匹配: 'clng'
关于VB的问题 rn<%rn dim fileobjectrn set fileobject=server.CreateObject("scripting.filesystemobject")rn dim textfilern set textfile=fileobject.opentextfile(server.MapPath("num.txt"),1)rn dim visitrn visit=clng(textfile.readline)rn visit=visit+1rn set textfile=fileobject.opentextfile(server.MapPath("num.txt"),2)rn textfile.writeline(visit)rn textfile.closern %>rn这个有什么问题没?提示说类型不匹配,望大家帮帮忙!
类型不匹配: tempaddtime
set rs=server.createobject("adodb.recordset")rnsql="select NewsID,UpdateTime,smallclassid from news where NewsID=" & NewsIDrnrs.open sql,conn,1,3rnsmallclassidnw=rs("smallclassid")rntempaddtime=rs("UpdateTime") 'UpdateTime是时间类型rnrs.closernrnrnset rs=server.createobject("adodb.recordset")rnsql="select * from news where NewsID="&NewsID rnrs.open sql,conn,3,3rnrnrs("fpath")=cstr(year(tempaddtime)) &"-" & cstr(month(tempaddtime)) 'fpath是文本类型rnrnrs.updaternrn数据库是access,如果把tempaddtime用now()代的话,就不会出现类型不匹配: tempaddtime这样的错误,不知道是怎么一回事
Vb类型不匹配
Private Sub Command1_Click()rnDim sn As String, code As Integerrnsn = Text1.TextrnIf sn = "" ThenrnMsgBox "机器码不能为空!", 16, "提示"rnEnd Ifrncode = 8631202577- sn - 1202rnText2.Text = codernrnrnrnEnd Subrnrn提示类型不匹配,应该怎么修改。
为何类型不匹配?
原部份代码如下:rn[code]rn...rn rn rn<% Dim sql,irnsql="select * from wenzhang where typetwo='分类' order by id desc" rnrs.open sql,conn,1,1rnIf rs.recordcount > 0 Thenrn rnFor i=0 To 10rn%>rn <%=rs("title")%><%=rs("createtime")%>rn<% rnrs.movenextrnNextrnEnd If rnrs.closern%>rnrnrn...rn[/code]rn在IE6中怎么老报:rnScript error detected at line 175. rnSource line: Response.Write rs("title") rnDescription: 类型不匹配: 'Response.Write'rn在access中title字段为"文本"rnrn另外有个问题:rn我的javascript怎么用外部调用的形式,老是提示缺少对像写在同一页里则不会有????rn在需要调用的页面中我是这么写的:rn
asp 类型不匹配
str = ""rn response.write(str)rn提示错误rnMicrosoft VBScript 运行时错误 (0x800A000D)rn类类型不匹配: '[string: "
重载运算符类型不匹配
#ifndef DAT_H_INCLUDEDrn#define DAT_H_INCLUDEDrn#includern#includern#includernusing namespace std;rnrnclass daternrnprivate:rn int year;rn int month;rn int day;rn int dton(date &a); //将指定日期转换成从0年O月O日起的天数rn date ntod(int b); //将指定的0年O月O日起的天数转换成对应的日期rn bool leap(int year);rnpublic:rn date();rn date(int y,int m,int d);rn friend istream &operator >> (istream &is,date &d);rn friend ostream &operator << (ostream &os,date &d);rn date operator +(int &days);rn date operator -(int &days);rn int operator -(date &da);rn void operator =(date &da);rn int dt(date &a);rn date nt(int b);rn bool le(int year);rn ~date();rn;rnrn#endif // DAT_H_INCLUDEDrnrn```rn#include"dat.h"rn#includern#includern#includernrnusing namespace std;rnrn static int day_tab[2][12] = 31,28,31,30,3l,30,3l,3l,30,31,30,31,rn 31,29,31,30,31,30,31,31,30,31,30,31;rnrndate::date()rnrn year = 0;rn month = 1;rn day = 1;rnrnrnrndate::date(int y,int m,int d)rnrn year = y;rn month = m;rn day = d;rnrnrnistream &operator >> (istream &is,date &d)rnrn cin >> d.year >> d.month >> d.day;rn return is;rnrnrnostream &operator << (ostream &os,date &d)rnrn cout << d.year << "." << d.month << "." << d.day << endl;rn return os;rnrnrnbool date::leap(int year)rnrn if((year % 4 == 0 && year % 100 != 0)||year % 400 == 0)rn return true;rn elsern return false;rnrnrndate date::operator +(int &days)rnrn int rest;rn rest = this->dt(*this) + days;rn return this->nt(rest);rnrnrnint date::dton(date &a)rnrn int ye,mo,da=0;rn for(ye = 0;ye < a.year;ye++)rn rn if(a.le(a.year))rn da += 366;rn else da += 365;rn rn for(mo = 0;mo < a.month-1;mo++)rn rn if(a.le(a.year))rn da += day_tab[0][mo];rn else da += day_tab[1][mo];rn rn da += a.day;rn return da;rnrnrndate date::ntod(int b)rnrn date a(0,1,1);rn int rest = b;rn while(1)rn rn if(a.le(a.year))rn rn rest -= 366;rn if(rest < 0)rn rn rest += 366;rn break;rn rn a.year++;rn rn elsern rn rest -= 365;rn if(rest < 0)rn rn rest += 365;rn break;rn rn a.year++;rn rn rn while(1)rn rn if(a.le(a.year))rn rn for(int i = 0;i < 12;i++)rn rn rest -= day_tab[0][i];rn if(rest < 0)rn rn rest += day_tab[0][i];rn break;rn rn a.month++;rn rn rn elsern rn for(int i = 0;i < 12;i++)rn rn rest -= day_tab[1][i];rn if(rest < 0)rn rn rest += day_tab[1][i];rn break;rn rn a.month++;rn rn rn break;rn rn a.day = rest;rn return a;rnrnrndate date::operator -(int &days)rnrn int da;rn da = this->dt(*this) - days;rn return this->nt(da);rnrnrnint date::operator -(date &da)rnrn int rest;rn rest = this->dt(*this) - da.dt(da);rn return rest;rnrnrnint date::dt(date &a)rnrnrn return dton(a);rnrnrndate date::nt(int b)rnrn return ntod(b);rnrnrnbool date::le(int year)rnrn return leap(year);rnrnrnvoid date::operator =(date &da)rnrn this->year = da.year;rn this->month = da.month;rn this->day = da.day;rnrnrndate::~date()rnrnrnrnrnrn#includern#includern#includern#include"dat.h"rnusing namespace std;rnrnint main()rnrnrn while(1)rn rn date *p = new date;rnrn cout << "请输入日期:" << endl;rn cin >> *p;rn int n;rn cout << "请选择功能:" << endl;rn cout << "1.将日期转化为天数\n" << "2.两日期相差天数\n" << "3.计算所加天数后日期\n" << "4.计算所减天数后日期\n" << "5.将天数转化为日期\n"rn << "6.退出" << endl;rn cin >> n;rn while(n<1||n>6)rn rn cout << "输入错误,请重新选择功能" << endl;rn n = 0;rn cin >> n;rn rn system("cls");rn switch(n)rn rn case 1:rn rn cout << p->dt(*p) << endl;rn system("pause");rn system("cls");rn break;rn rn case 2:rn rn date *q = new date;rn cout << "请输入日期:" << endl;rn cin >> *q;rn cout << *p - *q << endl;rn system("pause");rn system("cls");rn delete q;rn break;rn rn case 3:rn rn cout << "请输入天数:" << endl;rn int m;rn cin >> m;rn cout << *p + m << endl;rn system("pause");rn system("cls");rn break;rn rn case 4:rn rn cout << "请输入天数:" << endl;rn int k;rn cin >> k;rn cout << (*p - k) << endl;rn system("pause");rn system("cls");rn break;rn rn case 5:rn rn cout << "请输入天数:" << endl;rn int u;rn cin >> u;rn date q = p->nt(u);rn cout << q << endl;rn system("pause");rn system("cls");rn break;rn rn case 6:exit(0);rn rnrn rnrnrnrnrnrn报错:rn||=== Build: Debug in Date (compiler: GNU GCC Compiler) ===|rnD:\C++学习\Date\main.cpp||In function 'int main()':|rnD:\C++学习\Date\main.cpp|65|error: no match for 'operator<<' in 'std::cout << date::operator-(const int&)(((const int&)((const int*)(& k))))'|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|108|note: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>& (*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|117|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>& (*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|127|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|165|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|169|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|173|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\bits\ostream.tcc|91|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|180|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\bits\ostream.tcc|105|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|191|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|200|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|204|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|209|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|213|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|221|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\ostream|225|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char, _Traits = std::char_traits]|rnd:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\bits\ostream.tcc|119|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits]|rnD:\C++学习\Date\dat.h|21|note: std::ostream& operator<<(std::ostream&, date&)|rn||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|rn
相关热词 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天 c#func链接匿名方法 c#怎么创建文件夹 c#从键盘接收空格 c#da/ad c#部门请假管理系统 c#服务器socket c# 默认的访问修饰符