Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all 4356 articles
Browse latest View live

Commented Unassigned: Sys Undefined [27938]

$
0
0
I gotten one website that I downloaded to work with the autocomplete extender. I then created a new data scaffolding website using an ADO entity model. I have created a custom list form, which was generated by the data scaffolding, and am trying to put an autocomplete extender on it. I get a sys undefined error in internet explorer. I go into the debugger and see the error.

Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AutoCompleteBehavior, {"completionSetCount":100,"delimiterCharacters":"","enableCaching":false,"id":"txtName_AutoCompleteExtender","minimumPrefixLength":2,"serviceMethod":"GetDevelopments","servicePath":"/SewerCleaningHeaders/List.aspx","useContextKey":true}, null, null, $get("ContentPlaceHolder1_txtName"));
});

sys undefined.

I downloaded the the 15.1.3 version of ajax control tookit. It has done away with toolkit script manager and replaced it with scriptmanager. Which is what I needed because the page generated by the datascaffolding already has a script manager in the site master.

The code for the site master is as follows:

<%@ Master Language="VB" CodeFile="Site.master.vb" Inherits="Site" %>

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>


<!DOCTYPE html>

<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title>Dynamic Data Site</title>
<link href="~/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>

<h1 class="DDMainHeader">Dynamic Data Site</h1>
<div class="DDNavigation">
<a runat="server" href="~/"><img alt="Back to home page" runat="server" src="DynamicData/Content/Images/back.gif" />Back to home page</a>
</div>

<form id="form1" runat="server">
<div>
<%-- TODO: Enable partial rendering by setting the EnablePartialRendering attribute to "true" to provide a smoother browsing experience.
Leaving partial rendering disabled will provide a better debugging experience while the application is in development. --%>

<asp:ScriptManager id=ToolKitScriptManager1 runat="server" EnablePartialRendering="False" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/" Name="jquery" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" />
</Scripts>
</asp:ScriptManager>

the code in the custom form that I am only modifying is as follows ( with autocomplete extender on bottom)

<%@ Page Language="VB" MasterPageFile="~/Site.master" CodeFile="List.aspx.vb" Inherits="List" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>

<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
<DataControls>
<asp:DataControlReference ControlID="GridView1" />
</DataControls>
</asp:DynamicDataManager>




<h2 class="DDSubHeader"><%= table.DisplayName%></h2>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="DD">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
HeaderText="List of validation errors" CssClass="DDValidator" />
<asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" CssClass="DDValidator" />

<asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DisplayName") %>' OnPreRender="Label_PreRender" />
<asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" /><br />
</ItemTemplate>
</asp:QueryableFilterRepeater>
<br />
</div>

<asp:EntityDataSource ID="GridDataSource" runat="server" EnableDelete="true" />
<asp:Button ID="Button1" runat="server" Text="Search" />
<br />
<asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" EnablePersistedSelection="true"
AllowPaging="True" AllowSorting="True" CssClass="DDGridView"
RowStyle-CssClass="td" HeaderStyle-CssClass="th" CellPadding="6">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DynamicHyperLink runat="server" Action="Edit" Text="Edit"
/>&nbsp;<asp:LinkButton runat="server" CommandName="Delete" Text="Delete"
OnClientClick='return confirm("Are you sure you want to delete this item?");'
/>&nbsp;<asp:DynamicHyperLink runat="server" Text="Details" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="Add" DataNavigateUrlFormatString="~/SewerCleaningHeaders/Insert.aspx" />
</Columns>

<PagerStyle CssClass="DDFooter"/>
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
<EmptyDataTemplate>
There are currently no items in this table.
</EmptyDataTemplate>
</asp:GridView>

<div class="DDBottomHyperLink">
<asp:DynamicHyperLink ID="InsertHyperLink" runat="server" NavigateUrl=<%# table.GetActionPath("videolist", GetDataItem())%> Action="videolist"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" />Insert new item</asp:DynamicHyperLink>
</div>


</ContentTemplate>
</asp:UpdatePanel>



<asp:Label runat="server" ID="lblReferrerName" Text="Address: "></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:Label runat="server" ID="Label1" Text=" Select address and press button "></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Width="67px" />


<asp:AutoCompleteExtender ID="txtName_AutoCompleteExtender" BehaviorID="txtName_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True"
TargetControlID="txtName" MinimumPrefixLength="2" CompletionInterval="1000"
EnableCaching="false" FirstRowSelected="false" CompletionSetCount= "100" ServiceMethod="GetDevelopments"
UseContextKey="True">
</asp:AutoCompleteExtender>

<script src="~/Scripts/MicrosoftAjaxToolkit/MicrosoftAjax.js" type="text/javascript"></script>
<script src="~/Scripts/MicrosoftAjaxToolkit/Debug/AutoComplete.debug.js" type="text/javascript"></script>



</asp:Content>

I've never actually made one of my exsisting website work with the ajax am I missing something? I've worked on this for days and have tried many different things like copying the ajax control toolkit scripts, .js files to my website's scripts directory. Is that the wrong way to do it. They weren't there before. Tutorials that I've watched haven't even mentioned the script files but I saw it as one of the solutions.
Comments: It said it exceeded the limit. Is there an email address I can send it to.

Edited Issue: CalendarExtender year change bug when setting StartDate and EndDate [27346]

$
0
0
Using CalendarExtender from AJAX Control Toolkit latest version:

```
AjaxControlToolkit, Version=4.1.7.123, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e
```

After opening the extender I click on calendar header to get to month view, and once again to reach year view:

![Image](http://j.mp/VlBDbu)

If I click on the right arrow I reach the next screen of years, but clicking the left arrow does not allow me to reach the original list of years:

![Image](http://j.mp/VlCkBx)

I can still navigate right until the last available year is shown, but if I click on left arrow it will only go as back as this 2nd picture.

ASPX code that shows the problem:

```
<asp:TextBox runat="server" ID="txtCalendar" />
<asp:Button runat="server" ID="btnOpenCld" Text="Open" />
<act:CalendarExtender runat="server" ID="cldExtender"
TargetControlID="txtCalendar"
PopupButtonID="btnOpenCld"
StartDate="1/29/2013"
EndDate="12/31/2035" />
```

If I would set the year of StartDate to 1995, by clicking the left arrow I could only go as far as:

![Image](http://j.mp/1175HPT)

I tried various ways to set the start/end dates but the same problem remains.

Attached is a simple demo that manifests the bug.

Closed Issue: MaskedEditValidator.cs exception doesn't cause an validation failure [27179]

$
0
0
A date ending in all zeros doesn't cause an error in MaskedEdit validator. In short, 01/01/0000 should show the MinimumValueMessage but doesn't.

<asp:MaskedEditValidator MinimumValue="01/01/1900" MinimumValueMessage="<b>Out of Range</b><br />Date of Birth cannot be before 01/01/1900." MinimumValueBlurredText="*"/>

The root cause is System.DateTime.Parse throws an exception since c# MinDate is January 1, 0001.

The exception causes the validator to NOT call the callout.

I propose that line 795 of ./Server/AjaxControlToolkit/MaskedEdit/MaskedEditValidator.cs

case MaskedEditType.DateTime:
case MaskedEditType.Date:
case MaskedEditType.Time:
{
DateTime dtval = System.DateTime.Parse(Target.Text, ControlCulture);

becomes:
case MaskedEditType.DateTime:
case MaskedEditType.Date:
case MaskedEditType.Time:
{
DateTime dtval;
try
{
dtval = System.DateTime.Parse(Target.Text, ControlCulture);
}
catch
{
// a 0000 year causes an exception, set to MinValue
dtval = System.DateTime.MinValue;
}

I'm not sure whether there's other places which would need to be changed and whether this is the optimal approach. It's working for me.

Closed Issue: CollapsiblePanelExtender Loses Session in IE8 [27182]

$
0
0
If your CollapsiblePanelExtender's ImageControlID points to an ASP:Image control that does not have any ImageURL specified then it will cause IE8 to lose all session variables. The problem does not occur in IE9 or FF. The simple fix is to insure that your ImageControlID target has its ImageURL specified. You can use the ExpandedImage or the CollapsedImage. There is a temptation to skip the ImageURL because the CollapsiblePanelExtender automatically sets this value.

Closed Issue: CalendarExtender and CompareValidator [27183]

$
0
0
When using a CompareValidator control with the CalendarExtender, if you enter an invalid date and the CompareValidator shows the error message the CalendarExtender popup calendar will not stay shown it displays for a second and then hides again.

To reproduce:
Add a TextBox, CalendarExtender and CompareValidator on a test page and then load page and enter invalid date and then click on the calender icon.

Closed Issue: custom MasterPage ID breaks HtmlEditorExtender [27157]

$
0
0
(Using MAY 2012 ASP.NET 3.5 AJAX Toolkit release, IE7) When using a MasterPage, if you set the ID then the HtmlEditorExtender "popupDiv" always displays.

Ex:

on MasterPage codebehind:
protected void Page_Init(object sender, EventArgs e)
{
this.ID = "TEST"; // comment this out, the HtmlEditorExtender works properly
}

on Default.aspx - have the textbox and HtmlEditorExtender inside the ContentPlaceHolder

========== UPDATE

I forgot to mention, the reason for this appears to be because the "popupDiv" does not update with the new MasterPage ID, but the other elements do.

Using the MasterPage, setting this.ID = "TEST" on Page_Init

Default.aspx page referencing MasterPage:
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="cphContent">
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="10" />
<AjaxControlToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextBox1" />
</asp:Content>

renders as:

<textarea name="TEST$cphContent$TextBox1" rows="10" cols="20" id="TEST_cphContent_TextBox1"></textarea>
<input type="hidden" name="TEST$cphContent$HtmlEditorExtender1_ClientState" id="TEST_cphContent_HtmlEditorExtender1_ClientState" /><div Id="ctl00_cphContent_HtmlEditorExtender1_popupDiv" style="opacity: 0;" class="popupDiv"><div Id="ctl00_cphContent_HtmlEditorExtender1_btnCancel" style="float: right; position:relative; padding-left: 20px; top:10px; width: 55px; border-color:black;border-style: solid; border-width: 1px;cursor:pointer;" float="right" unselectable="on">Cancel</div></div>


As you can see, the popupDiv and btnCancel div both say "ctl00" instead of "TEST"... I'm thinking this has something to do with why this displays when you modify the MasterPage ID...

Closed Issue: Two components with the same id '{0}' can't be added to the application + filteredtextboxextender + updatepanel [27134]

$
0
0
I am using ajaxcontroltoolkit 4.1.51116

I have usercontrol1 which have forms field like textboxe with filteredtextboxextender.

I have taken this on another control from where i am opening fancybox popup and inside that usercontrol1.

First time it works great until i click on save button and my popup gets closed, it is showing me error like

Error: Sys.InvalidOperationException: Two components with the same id '{0}' can't be added to the application.

Source File: {websitepath}/ScriptResource.axd?d=wPieHs6t0D_3vdX0o6jGuxENo50qDQAI6KpZzOaUWxo9yqPP-ti3B-I8ReqWgk84TjzrH821Til527ueAUJxWZyLMgSWZ9e-GDW79kAbC16nGqq2-J1vH0LU75-t-UoUIR-VhA2&t=ffffffffc9f82b39

I have gone thru many formus and even issues on codeplex related with this but it is about autocomplete behavior but not about filteredtextboxextender.

Closed Issue: Bug in Tabcontrol Latest Release place in ModalPopupExtender [27119]

$
0
0
Placing Tabcontrol in ajax ModalPopupExtender Gives error how to fix it...

htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

_setFocus: function (obj) {
$get("__tab_" + obj.get_element().id).focus();

Sample Appliation code is

<asp:Button ID="btnUpdateTextItem_Cancel" runat="server" CssClass="btnUpdateTextItem_Cancel btnright"
Text="Cancel" />
<asp:Button ID="btnDoNothing1" runat="server" CssClass="btnright" Text="Hide" />
<ajaxToolkit:ModalPopupExtender ID="mpe_UpdateText" runat="server" DynamicServicePath=""
Enabled="True" TargetControlID="btnDoNothing1" PopupControlID="pnlUpdateTextItem"
BackgroundCssClass="modalBackground" OkControlID="ImageButton2" CancelControlID="btnUpdateTextItem_Cancel">
</ajaxToolkit:ModalPopupExtender>
<asp:ImageButton ID="ImageButton2" CssClass="close" runat="server" CausesValidation="False"
ImageUrl="../Images/close.gif" ToolTip="Close Email Collection " />
<asp:Panel ID="pnlUpdateTextItem" runat="server" CssClass="popup">
<ajaxToolkit:TabContainer ID="Tabsnickbee" runat="server" CssClass="tab">
<ajaxToolkit:TabPanel runat="server" ID="tabDetail" HeaderText="Details">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Role Name"></asp:Label>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="TabReports" HeaderText="Reports">
<ContentTemplate>
<h3>
Reports
</h3>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>

How to solve the issue.....




Created Unassigned: HtmlEditorExtender adding & when typing < or > [27942]

$
0
0
It seems the HtmlEditorExtender is adding a '&' when users enter '<' or '>':
* '>' ==> '&>'
* '<' ==> '&<'

Thanks for your help.

Configuration:
* IE 10
* VS2013
* .Net 4.5
* Web site with web forms

Commented Unassigned: AjaxFileUpload take more time to upload files [27450]

$
0
0
when i am uploading document in ajaxfileupload control , it is taking more time

docx,txt is uploading very fast
other types like xlsx, pdf or sql etc are taking more time

thanks
Manohar babu
Comments: Hi! We can't reproduce this issue. Please, provide a sample project that illustrates the described problem. Best regards, Fadil

Edited Issue: AjaxFileUpload take more time to upload files [27450]

$
0
0
when i am uploading document in ajaxfileupload control , it is taking more time

docx,txt is uploading very fast
other types like xlsx, pdf or sql etc are taking more time

thanks
Manohar babu

Commented Unassigned: Slider Handle seems to be disabled [27433]

$
0
0
Hi,

I have added the Extended Slider's dynamically from code behind. And I am getting the following errors:
![Image](https://skydrive.live.com/redir?resid=4CFD9A87074E190C!1037&authkey=!ALW0usssEbdJaxo).
"Sys.ArgumentException: Sys.ArgumentException: Please set valid values for the height and width attributes in the slider's CSS classes Parameter name: element size"

Although Slider renders fine and works perfectly fine on IE but not on Firefox and Chrome in these both browsers I simply can't change position of handle by clicking on the rail.

![Image](https://skydrive.live.com/redir?resid=4CFD9A87074E190C!1038&authkey=!ALW0usssEbdJaxo).

Any ideas what to do. I have already followed the following articles as well.

https://ajaxcontroltoolkit.codeplex.com/workitem/24421
https://ajaxcontroltoolkit.codeplex.com/workitem/27121

Thanks,

Attiqe
Comments: Hi! Please, provide a sample project to us for investigating. Thanks in advance! Best regards, Fadil

Edited Issue: Slider Handle seems to be disabled [27433]

$
0
0
Hi,

I have added the Extended Slider's dynamically from code behind. And I am getting the following errors:
![Image](https://skydrive.live.com/redir?resid=4CFD9A87074E190C!1037&authkey=!ALW0usssEbdJaxo).
"Sys.ArgumentException: Sys.ArgumentException: Please set valid values for the height and width attributes in the slider's CSS classes Parameter name: element size"

Although Slider renders fine and works perfectly fine on IE but not on Firefox and Chrome in these both browsers I simply can't change position of handle by clicking on the rail.

![Image](https://skydrive.live.com/redir?resid=4CFD9A87074E190C!1038&authkey=!ALW0usssEbdJaxo).

Any ideas what to do. I have already followed the following articles as well.

https://ajaxcontroltoolkit.codeplex.com/workitem/24421
https://ajaxcontroltoolkit.codeplex.com/workitem/27121

Thanks,

Attiqe

Commented Unassigned: How to change the Traget Control ID of TextboxWatermark Runtime [27426]

$
0
0
i want to change the Targer Control ID of textboxwatermark control runtime so how can i do that cause i am unable to get the TargetControlID property in .cs file after creating object of TextboxWatermark

Thanks
Comments: Hi! TextBoxWatermark inherits the TargetControlID property from its ExtenderControlBase base class, which in its turn inherits it from the ExtenderControl class. Thus, you can use this property with your TextBoxWatermark control to set a target control. Best regards, Fadil

Edited Issue: How to change the Traget Control ID of TextboxWatermark Runtime [27426]

$
0
0
i want to change the Targer Control ID of textboxwatermark control runtime so how can i do that cause i am unable to get the TargetControlID property in .cs file after creating object of TextboxWatermark

Thanks

Commented Issue: AsyncFileUpload Bug [27393]

$
0
0
When users are doing the upload using the AsyncFileUpload, a message appears in the control with the file's path in the server, but the message starts with "c:\fakepath\"...
Can i change this text?
Some users are thinking that that message is a bug.

Thanks!

E. Zarpelão
Comments: Hi! The message prefix "c:\fakepath\..." can't be changed, it's a browser security feature. It ensures the server doesn't have access to any file information on the client. Best regards, Fadil

Edited Issue: AsyncFileUpload Bug [27393]

$
0
0
When users are doing the upload using the AsyncFileUpload, a message appears in the control with the file's path in the server, but the message starts with "c:\fakepath\"...
Can i change this text?
Some users are thinking that that message is a bug.

Thanks!

E. Zarpelão

Commented Issue: The tab container ondemand doesn't play nice with the AutoCompleteExtender. [27389]

$
0
0
The tab container ondemand doesn't play nice with the AutoCompleteExtender.

Somehow the tab renders before the javascript can. Leaving the autocompleteextender useless on the page.

```

<asp:TabContainer ID="TabContainer1" runat="server" Width="950px" OnDemand="true">
<asp:TabPanel ID="TabPanel2" runat="server" ToolTip="" HeaderText="Search" OnDemandMode="Once">
<ContentTemplate>
<script type="text/javascript">
function item_selected_Permissions(sender, e) {
var HiddenFieldUserPerms = $get('<%= HiddenFieldUserPerms.ClientID %>');
HiddenFieldUserPerms.value = e.get_value();
}
</script>
<asp:TextBox ID="txtUserName" runat="server" Width="350"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtUserName_AutoCompleteExtender" runat="server" CompletionInterval="10" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetUsers" ServicePath="~/MyWebservice.asmx" TargetControlID="txtUserName" FirstRowSelected="True" OnClientItemSelected="item_selected_Permissions" CompletionSetCount="20" UseContextKey="True">
</asp:AutoCompleteExtender>
<asp:HiddenField ID="HiddenFieldUserPerms" runat="server" />
<asp:Label ID="lblinvaliduser" runat="server" ForeColor="Red" Text="Please select a user from the suggestion list"
Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorUserID" runat="server" ControlToValidate="txtUserName"
ErrorMessage="*" ValidationGroup="user"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
```
Comments: Hi! Thank you for sharing your experience. Unfortunately, we can't reproduce the issue you described. The AutoCompleteExtender works perfectly with the Tab control. Check out the screencast showing how it works with the sample project: http://screencast.com/t/gWXqo9qt4fw Feel free to contact me if you have further questions. Best regards, Fadil

Edited Issue: The tab container ondemand doesn't play nice with the AutoCompleteExtender. [27389]

$
0
0
The tab container ondemand doesn't play nice with the AutoCompleteExtender.

Somehow the tab renders before the javascript can. Leaving the autocompleteextender useless on the page.

```

<asp:TabContainer ID="TabContainer1" runat="server" Width="950px" OnDemand="true">
<asp:TabPanel ID="TabPanel2" runat="server" ToolTip="" HeaderText="Search" OnDemandMode="Once">
<ContentTemplate>
<script type="text/javascript">
function item_selected_Permissions(sender, e) {
var HiddenFieldUserPerms = $get('<%= HiddenFieldUserPerms.ClientID %>');
HiddenFieldUserPerms.value = e.get_value();
}
</script>
<asp:TextBox ID="txtUserName" runat="server" Width="350"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtUserName_AutoCompleteExtender" runat="server" CompletionInterval="10" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ServiceMethod="GetUsers" ServicePath="~/MyWebservice.asmx" TargetControlID="txtUserName" FirstRowSelected="True" OnClientItemSelected="item_selected_Permissions" CompletionSetCount="20" UseContextKey="True">
</asp:AutoCompleteExtender>
<asp:HiddenField ID="HiddenFieldUserPerms" runat="server" />
<asp:Label ID="lblinvaliduser" runat="server" ForeColor="Red" Text="Please select a user from the suggestion list"
Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidatorUserID" runat="server" ControlToValidate="txtUserName"
ErrorMessage="*" ValidationGroup="user"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
```

Closed Issue: AJAX ComboBox [27737]

$
0
0
Hi, i have issue with my combobox. Everything is working fine but i need my multiple column combobox to display only one column. What i need is when i select one value from it, where one row contain id number and name, to display only the id number. I use database from sql server for filling the combobox.

working in C#.

using (SqlConnection sqlConnection = new SqlConnection("Data Source=MILAN\\SQLEXPRESS;Initial Catalog=sm;Integrated Security=True"))
{
string sql = "sql";
SqlCommand sqlCmd = new SqlCommand(sql, sqlConnection);
sqlConnection.Open();

SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);

sqlDa.Fill(dt);

for (int i = 0; i < dt.Rows.Count; i++)
{
id = dt.Rows[i]["column_1"].ToString();
name = dt.Rows[i]["column_2"].ToString();
newName = id + " | " + name;
}
Viewing all 4356 articles
Browse latest View live