我正在创建一个SSIS包,并希望包含一个脚本,该脚本在检索文件并将该数据保存到表之前检查文件是否存在.
我有三个单独的变量,我已经设置:
fileExistFlag Int32 0
fileName String check.txt
folderPath String C:\
我的C#代码看起来像这样,我正在检查:
public void Main()
{
// TODO: Add your code here
String fp = Dts.Variables["User::folderPath"].Value.ToString() + Dts.Variables["User::fileName"].Value.ToString();
if (File.Exists(fp))
{
Dts.Variables["User::fileExistFlag"].Value = 1;
}
MessageBox.Show(fp);
MessageBox.Show(Dts.Variables["User::fileExistFlag"].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
}
Run Code Online (Sandbox Code Playgroud)
当我尝试编译我的脚本时,收到以下错误:
Cannot apply indexing with [] to an expression of type 'Microsoft.SqlServer.Dts.Runtime.Variables 对于所有四个实例.
我该如何解决这个问题?
更新的代码:
/*
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the …Run Code Online (Sandbox Code Playgroud) 我有以下 HTML:
<span id="ctl00_smpWeb" class="breadcrumb hidOverflow">
<span>
<a href="default.aspx" title="Home">
<img src="umb.png" alt="Home" title="Home" class="home" style="vertical-align: middle;" />
</a>
</span>
<span></span>
<span>Services</span>
</span>
Run Code Online (Sandbox Code Playgroud)
CSS:
.breadcrumb {
font: 9px 'Verdana', 'Graduate', 'Arial', 'Helvetica', 'sans-serif';
height: 30px;
color: #9b9b9b;
width: 100%;
font-weight: bold;
}
.hidOverflow {
overflow: hidden;
}
Run Code Online (Sandbox Code Playgroud)
输出:

主页图标不在两条橙色线之间垂直居中,而文本则是。
请帮助中心它。
如果我从图像中删除垂直对齐,则会发生这种情况:

我有以下显示图像的HTML代码:
<div>
<img id="wm01" alt="PP" title="PP" u="image" src="theImages/wm01.jpg" />
</div>
Run Code Online (Sandbox Code Playgroud)
我要做的是根据屏幕大小显示不同的图像.首先我用CSS隐藏图像:
#wm01 {
display: none;
}
Run Code Online (Sandbox Code Playgroud)
然后在我的身体中,我添加以下代码:
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
if (x<568) {
//alert(x);
document.getElementById("wm01").src="theImages/wm01_app.jpg";
document.getElementById("wm01").style.display = "block";
}
else {
document.getElementById("wm01").src="theImages/wm01.jpg";
document.getElementById("wm01").style.display = "block";
}
Run Code Online (Sandbox Code Playgroud)
图像未显示在任何尺寸的屏幕中.我该如何解决?
我的页面中有两个下拉列表:
<asp:DropDownList AutoPostBack="True" OnSelectedIndexChanged="ddlMain_SelectedIndexChanged" ClientIDMode="Static" ID="ddlMain" name="searchPhys" style="width: 365px;" class="default" runat="server" AppendDataBoundItems="true">
<asp:ListItem Text="BY PHYSICIAN" Value="0" Selected="True" />
<asp:ListItem Text="BY LOCATION" Value="1" />
<asp:ListItem Text="BY SPECIALTY" Value="2" />
</asp:DropDownList>
<br /><br />
<asp:DropDownList ClientIDMode="Static" ID="ddlDrillDown" name="searchPhys" style="width: 365px;" class="default" runat="server" AppendDataBoundItems="true">
</asp:DropDownList>
Run Code Online (Sandbox Code Playgroud)
我处理下拉列表更改的代码隐藏是:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Xml.Linq;
using System.Configuration;
using System.Windows.Forms;
using System.Data;
public partial class physicians : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
if …Run Code Online (Sandbox Code Playgroud) 我的网页里面有一个登录框 UpdatePanel
<asp:UpdatePanel runat="server" ClientIDMode="Static" ID="upSign" UpdateMode="Conditional">
<ContentTemplate>
<div class="dvHolder hidOverflow clearfix">
<input id="txtSUser" type="text" name="SUsername" value="" placeholder="Username" runat="server" />
</div>
<div class="dvHolder hidOverflow clearfix">
<input id="txtSPass" type="password" name="SPassword" value="" placeholder="Password" runat="server" />
</div>
<div class="dvHolder hidOverflow clearfix setTextRight">
<asp:Button ID="btnSignIn" ClientIDMode="Static" runat="server" Text="Sign In" OnClick="btnSignIn_Click" />
<asp:Label runat="server" Text="" ID="lblSSuccess" ClientIDMode="Static" CssClass="lblMsgSuccess" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
一旦用户成功验证,我想在延迟后显示一条消息并重定向(假设为5秒).我有以下代码,但它没有重定向:
public void btnSignIn_Click(object sender, EventArgs e)
{
lblSSuccess.Text = "We found you, now redirecting...";
lblSSuccess.ForeColor = ColorTranslator.FromHtml("#037203");
Session["UseIsAuthenticated"] = "true";
Response.AppendHeader("Refresh", "5;url=homepage.aspx"); …Run Code Online (Sandbox Code Playgroud) 我有一个ProgressBar在更改时调用另一个函数,但每隔一段时间我的应用程序崩溃并抛出一个NoSuchMethodError.我包括我的部分代码以及堆栈跟踪,以帮助我解决问题.
我的部分Java代码:
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
ShowText();
switch(seekBar.getId()) {
case R.id.syst_bar:
ShowText();
progress = progress + 70;
tvSVal.setText(String.valueOf(progress));
if (progress == 70) {
tvSOne.setTextColor(Color.parseColor("#4E9CD2"));
tvSTwo.setTextColor(Color.WHITE);
}
else if (progress == 190) {
tvSOne.setTextColor(Color.WHITE);
tvSTwo.setTextColor(Color.parseColor("#4E9CD2"));
}
else {
tvSOne.setTextColor(Color.WHITE);
tvSTwo.setTextColor(Color.WHITE);
}
break;
case R.id.dias_bar:
ShowText();
progress = progress + 40;
tvDVal.setText(String.valueOf(progress));
if (progress == 40) {
tvDOne.setTextColor(Color.parseColor("#4E9CD2"));
tvDTwo.setTextColor(Color.WHITE);
}
else if (progress == 100) {
tvDOne.setTextColor(Color.WHITE);
tvDTwo.setTextColor(Color.parseColor("#4E9CD2"));
}
else {
tvDOne.setTextColor(Color.WHITE);
tvDTwo.setTextColor(Color.WHITE); …Run Code Online (Sandbox Code Playgroud) 我有以下代码填充DropDownList:
DataSet ds = new DataSet();
SPSite mySite = SPContext.Current.Site;
SPWeb myWeb = mySite.OpenWeb();
SPList list = myWeb.Lists["GuidelineTopics"];
DTable_List = list.Items.GetDataTable();
DTable_List.TableName = "Table1";
DTable_List.DefaultView.Sort = "Title ASC";
ds.Tables.Add(DTable_List);
Topic.DataSource = ds.Tables["Table1"];
Topic.DataSource = DTable_List;
Topic.DataTextField = "Title";
Topic.DataValueField = "Title";
Topic.DataBind();
Topic.Items.Insert(0, new ListItem("All Topics", "All Topics"));
Topic.SelectedIndex = 0;
Run Code Online (Sandbox Code Playgroud)
如何将SORT应用于列表,使其按字母顺序排列为ASC或DESC?
我在SQL表列中有以下XML数据:
<root>
<Physicians>
<name></name>
<picture></picture>
<gender></gender>
<langAccept>English</langAccept>
<langAccept>Spanish</langAccept> (can appear more times)
<insAccept>Aetna</insAccept>
<insAccept>BCBS</insAccept> (can appear more times)
<specialty></specialty>
<specialty2></specialty2>
<specialty3></specialty3>
</Physicians>
</root>
Run Code Online (Sandbox Code Playgroud)
该langAccept和insAccept可以出现多次,也没有办法知道多少倍.
我有以下SQL查询,目前没有考虑'langAccept'和'insAccept'标签:
DECLARE @strProvider varchar(200)
SET @strProvider = '' --The Provider DropDownList
DECLARE @strSpecialty varchar(200)
SET @strSpecialty = '' --The Specialty DropDownList
DECLARE @strLocation varchar(200)
SET @strLocation = '' --The Location DropDownList
DECLARE @strGender varchar(200)
SET @strGender = '' --The Gender DropDownList
DECLARE @strInsurance varchar(200)
SET @strInsurance = '' --The Insurance DropDownList
DECLARE …Run Code Online (Sandbox Code Playgroud) 我有一个textarea,我按下回车输入多行文字:
<asp:TextBox ID="tbMessage" runat="server" ClientIDMode="Static"
TextMode="MultiLine" Columns="30" Rows="5"></asp:TextBox>
Run Code Online (Sandbox Code Playgroud)
我从代码隐藏中保存文本(MessageText列是类型varchar):
using (SqlCommand qSave = new SqlCommand())
{
qSave.Connection = oCon;
qSave.CommandType = CommandType.Text;
qSave.CommandText = @"INSERT INTO [Db1].[dbo].[Table1] (MessageText) VALUES (@MessageText)";
qSave.Parameters.AddWithValue("@MessageText", tbMessage.Text);
try
{
oCon.Open();
qSave.ExecuteNonQuery();
}
catch (SqlException ce)
{
}
finally
{
oCon.Close();
}
}
Run Code Online (Sandbox Code Playgroud)
我检索列并将其显示在代码隐藏的标签内:
public void MyFunction()
{
strSql = @"SELECT * FROM [Db1].[dbo].[Table1]";
using (SqlConnection conn = new SqlConnection(gloString))
{
try
{
// create data adapter
SqlDataAdapter da = new SqlDataAdapter(strSql, …Run Code Online (Sandbox Code Playgroud) 我有以下小提琴:http://jsfiddle.net/kmgj8ny9/
JQuery的:
$(document).ready(function(){
$(".chosen-select").chosen();
$("body").on("focus", ".htLeft", function (e) {
//alert(this);
$(this).parent("div").parent("div").find("div:first-child").first().removeClass("setNormal").addClass("setBold");
});
$("body").on("focusout", ".htLeft", function (e) {
$(this).parent("div").parent("div").find("div:first-child").first().removeClass("setBold").addClass("setNormal");
});
});
Run Code Online (Sandbox Code Playgroud)
如果textarea是聚焦的,则Comments标签是粗体,但如果聚焦下拉列表,则Issue标签不是粗体.
下拉列表是HTML生成的ASP.net控件.
我该如何解决?
c# ×7
asp.net ×6
css ×3
html ×2
android ×1
java ×1
javascript ×1
jquery ×1
sharepoint ×1
sql-server ×1
ssis ×1
xml ×1