WEB开发网
开发学院WEB开发ASP.NET .net 通过后台js上传表数据 阅读

.net 通过后台js上传表数据

 2012-12-29 16:14:18 来源:WEB开发网   
核心提示:this.MySQL += this.Fields[i]+"=null ";} else{if(i != 1) this.MySQL += ",";this.MySQL += this.Fields[i]+"='"+this.values[i]+&qu
this.MySQL += this.Fields[i]+"=null ";
} else
{
if(i != 1) this.MySQL += ",";
this.MySQL += this.Fields[i]+"='"+this.values[i]+"'";
}
}
this.MySQL += " where "+this.Fields[0]+"='"+this.values[0]+"'";
},
Delete:function()
{
this.MySQL="delete from "+this.TabName+" where ";
var j=0; //i,j可能并不同步,有些列值可能为空,表示不以其为条件,要保证sql的语法正确
for(var i=0;i<this.FieldCount;i++)
{
if(this.values[i]=="") continue;
if(this.values[i] == "NULL")
{
if(j != 0) this.MySQL += " and ";
this.MySQL += this.Fields[i]+" is null ";
} else
{
if(j != 0) this.MySQL += " and ";
this.MySQL += this.Fields[i]+"='"+this.values[i]+"'";
}
j++;
}
}
};


var fso, ts, s;
var ForReading = 1, ForWriting = 2;

var name;// = "c:\\web\\yafulwisad\\t\\t.csv";
name = Server.MapPath("t.csv");
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FileExists(name))
{
Response.Write(" 文件 "+name+" 存在!");
ts = fso.OpenTextFile(name, ForReading, true);
// ts.SkipLine();

var data=new TABLE(Request.QueryString("a")+"");

s = ts.ReadLine();
data.F(s);
Response.Write("<br/>"+data.FieldCount);
Response.Write("<br/>" + s.replace(/,/g,"\t") + "");
Response.Write("<br/>" + data.Fields + "");

while (!ts.AtEndOfStream)
{
s = ts.ReadLine();
// Response.Write("<br/>" + s.replace(/,/g,"\t") + "");
data.V(s);
Response.Write("<br/>" + data.MySQL + "");
RunSQL(data.MySQL);
}
ts.Close();
}
else
{
Response.Write(" 文件 "+name+" 不存在,请核对后查询!");
}
%>

上一页  1 2 

Tags:net 通过 后台

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接