小编R.D*_*.D.的帖子

备份集包含除现有数据库之外的数据库的备份

我正在尝试为我的数据库恢复SQL Server备份文件,但它发出如下错误:

备份集包含除现有数据库之外的数据库的备份

我在SQL Server 2008中的数据库和备份文件是在2005年.

可能是什么问题?

sql-server

453
推荐指数
14
解决办法
38万
查看次数

在FTP上传文件

我想将文件从一台服务器上传到另一台FTP服务器,以下是我上传文件的代码,但是它会抛出一个错误:

远程服务器返回错误:(550)文件不可用(例如,找不到文件,没有访问权限).

这是我的代码:

string CompleteDPath = "ftp URL";
string UName = "UserName";
string PWD = "Password";
WebRequest reqObj = WebRequest.Create(CompleteDPath + FileName);
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
reqObj.Credentials = new NetworkCredential(UName, PWD);
FileStream streamObj = System.IO.File.OpenRead(Server.MapPath(FileName));
byte[] buffer = new byte[streamObj.Length + 1];
streamObj.Read(buffer, 0, buffer.Length);
streamObj.Close();
streamObj = null;
reqObj.GetRequestStream().Write(buffer, 0, buffer.Length);
reqObj = null; 
Run Code Online (Sandbox Code Playgroud)

你能告诉我哪里出错了吗?

.net c# asp.net ftp ftpwebrequest

23
推荐指数
3
解决办法
9万
查看次数

根元素缺失

我正在从xxx URl读取xml,但由于缺少Root元素,我收到错误.

我读取xml响应的代码如下:

  XmlDocument doc = new XmlDocument();
  doc.Load("URL from which i am reading xml");
  XmlNodeList nodes = doc.GetElementsByTagName("Product");
  XmlNode node = null;
  foreach (XmlNode n in nodes)
   {
   }
Run Code Online (Sandbox Code Playgroud)

并且xml响应如下:

<All_Products>
   <Product>
  <ProductCode>GFT</ProductCode>
  <ProductName>Gift Certificate</ProductName>
  <ProductDescriptionShort>Give the perfect gift. </ProductDescriptionShort>
  <ProductDescription>Give the perfect gift.</ProductDescription>
  <ProductNameShort>Gift Certificate</ProductNameShort> 
  <FreeShippingItem>Y</FreeShippingItem>
  <ProductPrice>55.0000</ProductPrice>
  <TaxableProduct>Y</TaxableProduct>
   </Product>    
 </All_Products>
Run Code Online (Sandbox Code Playgroud)

你能告诉我哪里出错了.

c# xml asp.net

14
推荐指数
3
解决办法
8万
查看次数

查找数据库上的打开连接数

我的web应用程序在asp.net 2.0,c#2.0和sql server 208中如何在我的sql server 2008数据库上找到打开的连接数.有没有办法清除连接池.因为我的网站托管在共享主机上他们提供的连接有限.在我的编码中,我在使用后关闭了所有连接,但我仍然收到暂停数据库的警告.

任何人都可以告诉我如何在数据库上找到数字打开连接以及如何清除连接池.

我使用using语句进行连接,并在finally块中使用后关闭所有连接.所以尽管有错误,它会关闭oped连接.

提前致谢.

c# sql-server asp.net ado.net sql-server-2008

9
推荐指数
2
解决办法
1万
查看次数

将网格视图导出为Excel并将Excel文件保存到文件夹

我想保存导出网格视图数据的excel文件.我已编写代码将gridview数据导出到excel但我不知道如何保存导出的文件.

以下是我将gridview导出到excel的代码:

Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=MyFiles.xls");
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gvFiles.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
Run Code Online (Sandbox Code Playgroud)

c# asp.net

5
推荐指数
1
解决办法
7万
查看次数

垃圾回收器是否回收值类型内存

当我声明int a = 0;它是值类型时,它从堆栈中获取内存,所以当这个变量超出范围时,垃圾收集器会回收这个内存吗?

c# asp.net garbage-collection

3
推荐指数
1
解决办法
1491
查看次数

在键入时将文本框内容复制到另一个文本框

我写j查询将内容从一个文本框复制到另一个文本框.我不是矿山代码中j查询的专家

    $(function() {
    $('input[id$=tb1]').keyup(function() {
        var txtClone = $(this).val();
        $('input[id$=txtCustName]').val(txtClone);
    });
});
Run Code Online (Sandbox Code Playgroud)

jquery

2
推荐指数
1
解决办法
1万
查看次数

List <string> lst = new List()和List <>之间的区别lst = new List()

我只是想知道其中的差别之间List<string> lst = new List()List<> lst = new List()

c# asp.net

-5
推荐指数
1
解决办法
404
查看次数