FileUpload Control And MS SQL

Jun 1, 2006

I am trying to use the FileUpload control to save a filename to a SQL database. I'm using the OnUpdating event for my SQLDataSource to add the filename to the UpdateParameters. The OnUpdating event is firing but the FileName doesn't get added to the database. Any pointers as to why that might be would be very helpful.

Here's the code. Thanks much.

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="File Upload Testing" %>

<script runat="server">

Sub Page_Load()

Response.Write("UpdateParameters(0)=" & dsLabel.UpdateParameters(0).Name & "<br />")

Response.Write("UpdateParameters(1)=" & dsLabel.UpdateParameters(1).Name & "<br />")

End Sub



Sub dsLabel_OnUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs)

Dim FileUploadControl As FileUpload = DetailsView1.FindControl("FileUpload1")

Dim strFileName As String = FileUploadControl.FileName

dsLabel.UpdateParameters(0).DefaultValue = strFileName

dsLabel.UpdateParameters(1).DefaultValue = Request.QueryString("rgstnID")

Response.Write("dsLabel.UpdateParameters(0).DefaultValue = " & dsLabel.UpdateParameters(0).DefaultValue & "<br />")

Response.Write("dsLabel.UpdateParameters(1).DefaultValue = " & dsLabel.UpdateParameters(1).DefaultValue & "<br />")

End Sub

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h1>File Upload</h1>

This page should allow me to use the FileUpload Control to save a filename to an MS SQL Database.<br />

<br />

&nbsp;<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"

DataSourceID="dsLabel" Height="50px" Width="125px">

<Fields>

<asp:TemplateField HeaderText="File" SortExpression="labelName">

<EditItemTemplate>

<asp:FileUpload ID="FileUpload1" runat="server" />

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%# Bind("labelName") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:CommandField ButtonType="Button" ShowEditButton="True" />

</Fields>

</asp:DetailsView>

<br />

<br />

<asp:SqlDataSource ID="dsLabel" runat="server"

ConnectionString="Data Source=FILESERVER1;Initial Catalog=IM;Integrated Security=True"

OnUpdating="dsLabel_OnUpdating"

ProviderName="System.Data.SqlClient"

SelectCommand="SELECT labelName FROM tblProductRegistration WHERE (registrationID = @registrationID)"

UpdateCommand="UPDATE tblProductRegistration SET labelName = @LabelName WHERE (registrationID = @registrationID)">

<UpdateParameters>

<asp:Parameter ConvertEmptyStringToNull="True" Name="LabelName" />

<asp:QueryStringParameter Type="Int64" Name="registrationID" QueryStringField="rgstnID" />

</UpdateParameters>

<SelectParameters>

<asp:QueryStringParameter Name="registrationID" QueryStringField="rgstnID" />

</SelectParameters>

</asp:SqlDataSource>

</asp:Content>

View 2 Replies


ADVERTISEMENT

SQL Server DB And Fileupload Control

May 22, 2008

I have a project that is using an exsisting SQL DB that stores uploaded files and images into the DB.
I am trying to figure out how to take the file from the fileupload control and place it into the DB field.
Almost all the examples I've seen deal specifically with images but I will not know what the file type is. It could be an image, a word doc, and excel file, a text file ect.
I thought to use a INSERT statement but I wonder if that will work.
I know that fileupload.postedfile.saveas saves the file to a directory you name but that does not help me. I thought I could just use the fileupload.contents property in the Parameter add statement but that must not be an option as I cannot find and example of that usage besides that would just be too easy I guess.
Any help or code would be accepted with great gratituide. I realize that this is not the best way for performance but it is what it is and I cannot scrap the old DB I just have to make it work.
Thanks,
Ty

View 7 Replies View Related

FileUpload Control And SQL Server 2005.

Aug 15, 2006

Hello,
I have a FileUpload control on my webform. I would like a user to be able to upload a file to the server. Is there any way to store this file in SQL Server 2005?
Thanks
ASPSQL66

View 1 Replies View Related

Fileupload Inside A CreateuserWizard Control ?

Sep 7, 2006

HiHoping someone can help me , I am looking to add a file upload inside a createuserWizard but am banging my head at this stage I can get in working saving the file selected in the Fileupload into  a table on the database using a datatype "image" for the field.However
ideally I would like to save a string of the file path to the database
and save the  actual file to the filesystem of the webserver.The
problem for me is that this is inside a CreateUserWizard, I gather the
standard information and them have "extended" the wizard  by adding
another wizard step , which will include a FileUpload control. I need
to invoke the FileUpload when the user select the createUser button of
the CreateUserWizard control( CreateUserWizard1_CreatedUser in the aspx.cs)  I
am able to write the SQL that  allows save information from a textbox
to a database tabel but not able to write the functionality to 1.Uplaod file to webServer when user selects Create User button 2. Save this path in a table on the database.I've tried loads but cannot get it to work I'm using C# for this.  here's a scaled down version of my code with just teh CreateUserWizard which contains the fileUploadaspx ( Contains a create user Wizard which inturn contains a Fileupload) <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="FORUMcreateuser.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server">    <title>Sign Up Page</title></head><body>    <form id="form1" runat="server" enctype="multipart/form-data">       
<atlas:ScriptManager id="MasterScriptManager"
EnableScriptGlobalization="false"
runat="Server"></atlas:ScriptManager>    <div>       
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
BackColor="White" BorderColor="#FFDFAD" BorderStyle='Solid'
BorderWidth='1px' Font-Names='Verdana' Font-Size='0.8em'
OnCreatedUser='CreateUserWizard1_CreatedUser'>            <WizardSteps>                <asp:WizardStep ID="CreateUserWizardStep0" runat="server">                    <table id="Table2" style='width: 100%'>                        <tr>                            <td style='color: blue'>                                <strong>Step 1 of 2</strong></td>                            <td style='color: white'>                                PlaceHolderBGColor</td>                            <td>                            </td>                        </tr>                        <tr>                            <td>                            </td>                            <td style='color: white'>                            </td>                            <td>                            </td>                        </tr>                        <tr>                            <td>                                First Name:</td>                            <td>                                <asp:TextBox runat="server" ID="txtFirstName" MaxLength="50" />                            </td>                            <td>                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator15" ControlToValidate="txtFirstName"                                     ErrorMessage="First Name is required." />                            </td>                        </tr>                        <tr>                            <td>                                Last Name:</td>                            <td>                                <asp:TextBox runat="server" ID="txtLastName" MaxLength="50" />                            </td>                            <td>                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator16" ControlToValidate="txtLastName"                                     ErrorMessage="Last Name is required." />                            </td>                        </tr>                        <tr>                            <td>                            </td>                            <td style='color: white'>                                PlaceHolderBGColor</td>                            <td>                            </td>                        </tr>                        <tr>                            <td>                                File:</td>                            <td>                                &nbsp;<asp:FileUpload ID="FileUpload1" runat="server" />                            </td>                            <td>                                &nbsp;</td>                        </tr>                        <tr>                            <td>                            </td>                            <td>                            </td>                            <td>                            </td>                        </tr>                    </table>                    <br />                </asp:WizardStep>                               <asp:CreateUserWizardStep ID="CreateUserWizardStep2" runat="server">                <ContentTemplate>                    <table>                        <tr>                            <th align="left" style='color: blue'>                                Step 2 of 2</th>                        </tr>                        <tr>                            <th align="left">                                MRS Login Details                            </th>                        </tr>                        <tr>                            <td>Username:</td>                            <td>                                <asp:TextBox runat="server" ID="UserName" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator9" ControlToValidate="UserName"                                     ErrorMessage="Username is required." />                            </td>                        </tr>                        <tr>                            <td>Password:</td>                            <td>                                <asp:TextBox runat="server" ID="Password" TextMode="Password" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator10" ControlToValidate="Password"                                     ErrorMessage="Password is required." />                            </td>                        </tr>                        <tr>                            <td>Confirm Password:</td>                            <td>                                <asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator13" ControlToValidate="ConfirmPassword"                                     ErrorMessage="Confirm Password is required." />                            </td>                        </tr>                        <tr>                            <td>Email:</td>                            <td>                                <asp:TextBox runat="server" ID="Email" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator11" ControlToValidate="Email"                                     ErrorMessage="Email is required." />                            </td>                        </tr>                        <tr>                            <td>                                Recover Password Question:</td>                            <td>                                <asp:TextBox runat="server" ID="Question" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator12" ControlToValidate="Question"                                     ErrorMessage="Question is required." />                            </td>                        </tr>                        <tr>                            <td>                                recover Password Answer:</td>                            <td>                                <asp:TextBox runat="server" ID="Answer" />                               
<asp:RequiredFieldValidator runat="server"
ID="RequiredFieldValidator14" ControlToValidate="Answer"                                     ErrorMessage="Answer is required." />                            </td>                        </tr>                        <tr>                            <td colspan="2">                                 <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"                                       
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The
Password and Confirmation Password must
match."></asp:CompareValidator>                            </td>                        </tr>                        <tr>                            <td colspan="2">                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>                            </td>                        </tr>                    </table>                   
<asp:SqlDataSource ID="InsertExtraInfo" runat="server"
ConnectionString="<%$ ConnectionStrings:CONTACTSConnectionString
%>"                        InsertCommand="INSERT INTO [CLIENT]
([client_id], [First_Name], [Last_Name]) VALUES (@UserId, @FirstName,
@LastName)"                        ProviderName="<%$ ConnectionStrings:CONTACTSConnectionString.ProviderName %>">                        <InsertParameters>                           
<asp:ControlParameter Name="FirstName" Type="String"
ControlID="txtFirstName" PropertyName="Text" />                           
<asp:ControlParameter Name="LastName" Type="String"
ControlID="txtLastName" PropertyName="Text" />                        </InsertParameters>                                           </asp:SqlDataSource>                                    </ContentTemplate>                </asp:CreateUserWizardStep>                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">                </asp:CompleteWizardStep>            </WizardSteps>            <NavigationButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle='Solid'                BorderWidth="1px" Font-Names="Verdana" ForeColor="#990000" />            <HeaderStyle BackColor="#FFCC66" BorderColor="White" BorderStyle='Solid' BorderWidth='2px'                Font-Bold="True" Font-Size="0.9em" ForeColor="#333333" HorizontalAlign="Center" />            <CreateUserButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle='Solid'                BorderWidth="1px" Font-Names="Verdana" ForeColor="#990000" />            <ContinueButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle='Solid'                BorderWidth="1px" Font-Names="Verdana" ForeColor="#990000" />            <SideBarStyle BackColor="#990000" Font-Size="0.9em" VerticalAlign="Top" />            <TitleTextStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />            <SideBarButtonStyle ForeColor="White" />        </asp:CreateUserWizard>    </div>    </form></body></html> aspx.cs using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {    }    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)    {        TextBox UserNameTextBox =            (TextBox)CreateUserWizardStep2.ContentTemplateContainer.FindControl("UserName");        SqlDataSource DataSource =            (SqlDataSource)CreateUserWizardStep2.ContentTemplateContainer.FindControl("InsertExtraInfo");        MembershipUser User = Membership.GetUser(UserNameTextBox.Text);        object UserGUID = User.ProviderUserKey;        DataSource.InsertParameters.Add("UserId", UserGUID.ToString());        DataSource.Insert();    }}  

View 1 Replies View Related

Uploading A File To A SQL Database Via A Typed Dataset And Using The FileUpload Control.

Oct 2, 2006

I am trying to upload a file in ASP.net 2.0 to a SQL database using the FileUpload control. I am doing this by way of a typed dataset.Here is my code.Dim rta As New ResponseTableAdapterDim rdt As ResponseDataTable = rta.GetResponseByID(1)Dim rr As ResponseRow = rdt(0)Dim fs As New FileStream(fu.PostedFile.FileName, FileMode.Open, FileAccess.Read)Dim br As New BinaryReader(fs)Dim image() As Byte = br.ReadBytes(fs.Length)br.Close()fs.Close()rr.UploadFile = imagerr.NameFile = fs.Namerta.Update(rdt)The code runs without an error but afterwards I find that nothing has been stored in the UploadFile cell in the database but the file name has been stored in the NameFile cell in the database. Any ideas?Your help is much appreciated. James 

View 1 Replies View Related

FileUpload

Apr 13, 2006

    I have gotten FileUpload in VB.Net to work fine in saving a file to a web server folder but cannot find some examples on how to save the file as an image on sql200.  Can anyone point me in the write direction - thanks.

View 3 Replies View Related

Using FileUpload To Store Image In SQL Database

Apr 24, 2008

Hi
I have a asp:FileUpload conponent that I am trying to use to retrieve a picture file from the clients pc and store it in a SQL database.
The table is called PropertyImage and it contains the following fields:
imgID (type = int - autoincrement); imgData (type = Image); imgTitle (type = VarChar); imgType (type = VarChar); imgLength (type = BigInt);
I have a button (Button1) which when clicked calls Button1_Click()
--------------------------------------------------protected void Button1_Click(object sender, EventArgs e)
{byte[] fileData = null;
Boolean status = false;if (FileUpload1 != null)
{
// Make sure the file has data.if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
{
// Get the filename.string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
try
{
// Access the file stream and begin the upload. Store the file in a memory byte array.Stream MyStream = FileUpload1.PostedFile.InputStream;
long iLength = MyStream.Length;fileData = new byte[(int)MyStream.Length];MyStream.Read(fileData, 0, (int)MyStream.Length);
MyStream.Close();
}catch (Exception ex)
{ }
}
}SqlConnection connection = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\heidihomes.mdf;Integrated Security=True;User Instance=True");
try
{
connection.Open();SqlCommand sqlCmd = new SqlCommand("INSERT INTO PropertyImage (imgData, imgaTitle, imgType, imgLength) VALUES(@data,@title,@type,@length)");
SqlParameter param = new SqlParameter();
// String connectionString = new SqlConnection(sqlCmd, connection);
 param = new SqlParameter("@data", SqlDbType.Image);
param.Value = fileData;
sqlCmd.Parameters.Add(param);param = new SqlParameter("@title", SqlDbType.VarChar);
param.Value = fileData;
sqlCmd.Parameters.Add(param);param = new SqlParameter("@type", SqlDbType.VarChar);
param.Value = fileData;
sqlCmd.Parameters.Add(param);param = new SqlParameter("@length", SqlDbType.BigInt);
param.Value = fileData;
sqlCmd.Parameters.Add(param);
sqlCmd.ExecuteNonQuery();
connection.Close();status = true;
}catch (Exception ex){ }if (status)
{
UploadStatus.Text = "File Uploaded Successfully";Server.Transfer("Admin_PropertyView.aspx");
}
else
{UploadStatus.Text = "Uploaded Failed";
}
}
}
--------------------------------------------------
But when I click on the button, nothing happens.
Please could someone help me out here.  I have tried this a few times and still haven't come right.
Also, if there is something else wrong with the code, please let me know.
Thanking you in advance.

View 9 Replies View Related

Store Files In SQL From An ASP Page Using FileUpload

May 23, 2008

I am almost done with a simple page to have a user select a file (using the FileUpload object), give it a short description and associate it with an item from a listbox.  Thensave these pieces of data to a new row in a SQL DB.
My issue... 
The SQLSmd.ExecuteNonQuery FAILS...
I have got all the fields able to connect and almost save... but for the actual "document" field errors out.  The user can select any type of file (image, word, excel, Powerpoint, etc) for storage into the DB.  I am not storing a referance to a file or the path to a file but the actual file in SQL.In the DB I have the field (Document) set to a type of VarBinary(8000) in the table.  Here is thethe corrisponding code in my app... 
Dim bArray As Byte...bArray = FileUpload1.PostedFile.InputStream.ReadByte()... SQLCmd.Parameters.Add("@Document", Data.SqlDbType.VarBinary, 8000).Value = bArray...iReturn = SQLCmd.ExecuteNonQuery()
ERRORThe first section of the stact trace...
[InvalidCastException: Invalid cast from 'System.Byte' to 'System.Byte[]'.]   System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +867   System.Byte.System.IConvertible.ToType(Type type, IFormatProvider provider) +37   System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +408   System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) +896

View 7 Replies View Related

Issue With SSRS Report Exporting To Excel With The Matrix Control Inside The Table Control

Jan 27, 2008

Hi All,
I am placing a Matrix inside the table control for grouping requirements,but when we export the report to the Excel, the contents inside the table cell are ignored. Is there any way to get the full report exported, as per the Requirement.Please help me with this issue.

With Thanks
M.Mahendra

View 5 Replies View Related

Is It Possible To Embbed And Ocx Control On A Report Or Some Sort Of Interactive Control Like A Flash.ocx?

Oct 25, 2007

does any one have and example of how to embedd a flash swf file onto a report.??? Is it possable? any examples would be helpful.

View 1 Replies View Related

Reporting Services From WebBrowser Control - Print = Unable To Load Client Print Control

Mar 20, 2007

UPDATE #2: When it said "Do you want to install Microsoft SQL Server" I said "yes" and that caused it to work. I exited and re-ran and now the print runs w/o the "install SQL Server" (If the prompt had said "Do you want to install the print dialog" we wouldn't be having this discussion...) 





UPDATE: After posting this i discovered that the same thing occurs when attempting to print the report direct from IE6: First a dialog pops up "Do you want to install this software?" Name: Microsoft SQL Server. When I click "Don't Install" I get the dialog "unable to load client print control." Since this happens direct from IE6 I suspect it's browser settings. I'll resume tomorrow and post a followup.







My WinForm C# app integrates Reporting Services by calling them from WebBrowser controls. The problem is attempts to print cause a dialog: "unable to load client print control."

I've read prior posts that say "enable Active-X in your browser" - I don't know how to do that from a WebBrowser control.



Any ideas how to support Reporting Services "Print" from within a WebBrowser control?

RELATED THREADS

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=332145&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=264478&SiteID=1

 

 

View 1 Replies View Related

T-SQL Control Of DTS

Aug 10, 2000

Hi,

I want to be able to alter the filename that my DTS package imports programmactically with a T-SQL stored procedure.

Is this possible, I really dont want to write a VB/COM package just to do this!

Jason

View 1 Replies View Related

.sql Control String

Apr 19, 2007

My development environment includes Visual Web Developer, SQL Server 2005 Express and SQL Server Management Studio Express.  I have a .sql control string that creates a database.  The control string is in my App_Data folder within my web site.  When I use SQL Server Managment Studio Express to run the .sql control string and create the tables etc. it does it in my SQLEXPRESS folder and not in the web.
How do I run the .sql file so it will create the database in my App_Data folder within the web site?
Thanks,
Kyleq

View 1 Replies View Related

Image Control And DB

Sep 15, 2007

I wanna know how to retrieve & insert an image from/to a Sql Server database.
using image control or any other control 
I’ve done that with windows form picture box.
As that was explained in MS tutorials  
Code….
-------------------------------------------Dim ms As New MemoryStreamPictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)Dim arrImage() As Byte = ms.GetBuffer
ms.Close()   Dim strSQL As String = _            "INSERT INTO Emp (EmpName,EmpSalary,Picture)" & _            "VALUES (@EmpName,@EmpSalary,@Picture)"  Dim cmd As New SqlCommand(strSQL, ConnEmp) With cmd     .Parameters.Add(New SqlParameter("@Picture", _      SqlDbType.Image)).Value = arrImage       .Parameters.Add(New SqlParameter("@EmpName", _       SqlDbType.NVarChar)).Value = txtEmpName.Text        .Parameters.Add(New SqlParameter("@EmpSalary", _        SqlDbType.Decimal)).Value = txtEmpSalary.Text   End With 
 cmd.ExecuteNonQuery()
------------------------------------------- 
But with a web form’s image control I DO NOT know how to do it    
I real appreciate your help 
Thank you
 

View 1 Replies View Related

Sqldatasource Control

Oct 23, 2007

please explain selectparameters and conflict detection property within sqldatasource control
mohsen

View 1 Replies View Related

Databinding To An ASP.NET Control

Mar 4, 2008

Hi,i have a question, i have a VS2005 and a SQL server 2000 enterprise in my office that i used for web developement,iam new to this, i made a data driven site using some automated controls available in the toolbox, but i need to made some manual process, like i need to make a LABEL show the SUM of specific number fields from my data base, they say i have to make a OLEDB connection using VB, but i don't know how,can you tell me how?Thanks  

View 13 Replies View Related

Sqldatasource Control

May 6, 2008

hi friends,
I created sqldatasource control. In select command i written the query like this  "select * form emp" and bounded in grid.How can I change the query for searching the details according the date wise when i click the search button.
 

View 14 Replies View Related

SqlDataSource Control

Jun 7, 2008

Hello experts
i have a SqlDataSource Control on my web form. Here is the source for the control
<asp:SqlDataSource ID="sqlSearchDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DbefomsConnectionString %>"
SelectCommand="SELECT [icon], [file_name], [path] FROM [tblfile] WHERE ([file_name] = @file_name)">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" DefaultValue="0" Name="file_name" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
This control displays icon, file_name, path in GridView Control
The problem is How can i store the above field values in an asp.net variable.
Thanks
Regards
Ali

View 1 Replies View Related

Concurrency Control

Apr 6, 2005

Hi! I'm building a web application with ASP.NET, and using MS SQL 2000 for my database server.
How should I do to guarantee the integrity of the data in spite of the concurrent access? Meaning... how can I make sure that more than 1 user can update 1 table at the same time, while no error will occur? Do I need to add some codes at my aspx file? Or do I need to do something to my database? Or do I not have to worry about it?
Thank you.

View 1 Replies View Related

SQLConnection Control

May 18, 2005

If i use the TimeTracker app from the starter kit suite and I enter my SQL connection in the web.config file it works fine,
 
If i build a simple app with just a sqladapter, sqlconnection and dataset control then enter in the page_load procedure
 
sqlDataAdater1.fill(dataset11)
datagrid1.databind()
It keeps giving my errors see below:  I created a connection with the sqlconnection control and used the same userid and password I used in the time tracker stater kit's web config file which works - I have no idea what is going on
 
*** is it better to create the sqlconnection control first then create the sqladapter or vise versa.
Server Error in '/WebApplication2' Application.


Login failed for user 'IssueTrackerUser'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'IssueTrackerUser'.Source Error:



Line 55: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 56: 'Put user code to initialize the page here
Line 57: SqlDataAdapter1.Fill(DataSet11)
Line 58: DataGrid1.DataBind()
Line 59: Source File: c:inetpubwwwrootWebApplication2WebForm1.aspx.vb    Line: 57 Stack Trace:



[SqlException: Login failed for user 'IssueTrackerUser'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
WebApplication2.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootWebApplication2WebForm1.aspx.vb:57
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()



Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
 

View 1 Replies View Related

Using The Sqldatasource Control

Dec 7, 2005

Do you have to use the sqldatasource in conjuction with another control like gridview or dropdown list?
I'd like to check to see if a record exists in one table before inserting data into another.
 
thanks
 

View 1 Replies View Related

SqlDataSource Control

Jan 31, 2006

Hello.I'm new to ASP.NET and trying to write data to a Microsft SQL Server. I have created a SqlDataSource control, which is 'connected' to my SQL server.Now my question is how i can put data in the database throw the control, and read data from it. I've read the site, but it's still unclear for me..Greetings!

View 1 Replies View Related

Control Parameter Help......

May 4, 2006

I'm writing a page to do some reporting off of one of our databases, and I'm using 3 control parameters for my sql query that feeds my datagrid.  2 of the ControlParameters are from dropdownlists, and one is from a RadioButtonList.  The ControlParameters that reference the dropdownlists are both working well, but the one for the RadioButtonList is not. 
The error I am getting is: Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '@Booga'.  (I changed my ControlParameter name from DateStr to Booga to try to avoid any conflicts with reserved words.)Any ideas?  Here is a snippet of my code:
<form id="form1" runat="server">
<table width="100%">
<tr>
<td style="text-align: center">
<strong>DataCenter</strong></td>
<td style="text-align: center">
<strong>Time Scope</strong></td>
<td style="text-align: center">
<strong>Call Status</strong></td>
</tr>
<tr>
<td style="height: 47px; text-align: center">
<asp:DropDownList ID="DropDownList1" DataSourceID="SqlDataSource2" AutoPostBack="true" DataTextField="LocationName" runat="server" />
</td>
<td style="height: 47px; text-align: center">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" Font-Size="Smaller">
<asp:ListItem Selected="True" Value=" 1 = 1 ">All</asp:ListItem>
<asp:ListItem Value="((CAST(CallLog.RecvdDate AS smalldatetime) + 1) >= (CAST(GETDATE() AS smalldatetime)))">Last Day</asp:ListItem>
<asp:ListItem Value="((CAST(CallLog.RecvdDate AS smalldatetime) + 7) >= (CAST(GETDATE() AS smalldatetime)))">Last Week</asp:ListItem>
<asp:ListItem Value="((CAST(CallLog.RecvdDate AS smalldatetime) + 30) >= (CAST(GETDATE() AS smalldatetime)))">Last 30 Days</asp:ListItem>
<asp:ListItem Value="((CAST(CallLog.RecvdDate AS smalldatetime) + 120) >= (CAST(GETDATE() AS smalldatetime)))">Last 120 Days</asp:ListItem>
</asp:RadioButtonList></td>
<td style="height: 47px; text-align: center">
<asp:DropDownList ID="DropDownList2" AutoPostBack="true" runat="server">
<asp:ListItem Selected="True" Value="Open">Open</asp:ListItem>
<asp:ListItem Value="Closed">Closed</asp:ListItem>
</asp:DropDownList></td>
</tr>
</table>
<br />
<p style="text-align: center"><strong>Displaying All Open Tickets</strong><br /></p>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" SelectCommand="SELECT DISTINCT [locationname] FROM [profile]"
ConnectionString="<%$ ConnectionStrings:Heat %>" />
<table width="100%">
<tr width="100%">
<td valign="top" width="100%">
<asp:GridView ID="GridView1" AllowSorting="True" runat="server"
DataSourceID="SqlDataSource1" DataKeyNames="CallID"
AutoGenerateColumns="False" Font-Size="Smaller" Width="100%" >
<Columns>
<asp:CommandField />
<asp:BoundField DataField="CallID" HeaderText="Call ID" ReadOnly="True" SortExpression="CallID" />
<asp:BoundField DataField="CustID" HeaderText="Customer ID" ReadOnly="True" SortExpression="CustID" />
<asp:BoundField DataField="CallType" HeaderText="Call Type" ReadOnly="True" SortExpression="CallType" />
<asp:BoundField DataField="Priority" HeaderText="Priority" ReadOnly="True" SortExpression="Priority" />
<asp:BoundField DataField="Cause" HeaderText="Cause" ReadOnly="True" SortExpression="Cause" />
<asp:BoundField DataField="CallDesc" HeaderText="Call Description" ReadOnly="True" SortExpression="CallDesc" >
<ItemStyle Width=40% />
</asp:BoundField>
<asp:BoundField DataField="RecvdBy" HeaderText="Received By" ReadOnly="True" SortExpression="RecvdBy" />
<asp:BoundField DataField="RecvdDate" HeaderText="Call Date" ReadOnly="True" SortExpression="RecvdDate" >
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="RecvdTime" HeaderText="Call Time" ReadOnly="True" SortExpression="RecvdTime" >
<ItemStyle Wrap="False" />
</asp:BoundField>
</Columns>
</asp:GridView>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM CallLog INNER JOIN Profile ON CallLog.CustID = Profile.CustID WHERE (Profile.LocationName = @LocationName) AND (CallLog.CallStatus = @CallStatus) AND @Booga "
ConnectionString="<%$ ConnectionStrings:Heat %>">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="LocationName" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList2" Name="CallStatus" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="RadioButtonList1" Name="Booga" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
<br />
<br />
<br />
<br />
</form>

View 2 Replies View Related

DetailsView Control (Please Help!!!!)

May 14, 2006

Can someone please tell me what I am doing wrong...
I have a simple webform that has contains a GridView and a DetailsView. Once the GridView is populated the user simply selects a record from the list.  The DetailsView is them populated with all of the data from the selected record.
The DetailsView is bound to a SQL DataSource/CustomerData. I have made sure that the DV control has the Edit/Update Command listed.  The user can click the Edit button and successfully edit the fields but when the user clicks the "Update" button I am getting the following message.
Updating is not supported by data source 'CustomerData' unless UpdateCommand is specified
Why isnt the control handling the Update.
Many Thanks!!!!
T
 
 

View 4 Replies View Related

Revision Control

Mar 25, 1999

Does SQL 6.5 integrate with visual source safe to provide revision control of your stored procedures and queries? If not, is there a product for controlling revision control on a SQL 6.5 server?

View 1 Replies View Related

SQL Code Control

Nov 3, 2005

Is anybody aware of how I can audit redundant Stored Procedures [SP] out of a large application. I only have the SQL-Server (no Sourcesafe/CVS). I need to know when an SP was last accessed. There are over seven hundered SPs.

Any help appreciated

Neil.

View 3 Replies View Related

DTS Access Control

Mar 2, 2006

Is there any access control available for the DTS package? I want to create an a/c that can create/modify but cannot delete DTS. Is there any way I can do that?

View 2 Replies View Related

How To Control The Trigger

Jun 16, 2006

Hi

I have trigger,that trigger having Procedure(This procedure is ment for sending mails),if we insert data we have to send mails about 2000 mails,this is goal,mail sending is OK but at that my application getting slow

can some give me the Best solution on this


regards
sreenivas

View 2 Replies View Related

Table Control

Dec 16, 2006

hi all,
i wonder if could accomplish this problem in sql..

say i wanna total sum up some qty in table 1, and the sum up qty appear in table 2.. means everytime qty in table 1 change, it will sum up automatically total qty in tbl1 :-

table 1
id qty
1 5
2 5
2 5
1 5

table 2
id SumQty
1 10
2 10

note: table 2 will sum up automatically, isit possible to do this?

View 5 Replies View Related

Change Control

Nov 21, 2007

Does any one have any suggestion to what you require for a change to database, or creation of a new database?

I have been asked to create an online form. Not that we haven't done change control in the past but most just come in a form of an e-mail, and it's more of the reason for the change and the code to run.

So I'm just curios as to what other people do. I haven't found anything on the net.

I'm starting with requiring the database instance name, object owner, object name, object type, the desired change, and date requested.

Thanks,

View 1 Replies View Related

CountrySelector Control

Jul 20, 2005

Hello allI am developing a CountrySelector control (which I would like to sharewith anyone), but I am quite a newby in this custom control area.You can find it at:http://home.kabelfoon.nl/~juliusd/v...ntrySelector.vbSome questions I have are:- In what event should the items be added. In this case (PreRender)items added on every render (duh) and get duplicated when ViewState isenabled. Best would be if the items show up in the designer alreadybut only in designmode and not with <ListItem> in the HTML source.- How can I override ViewState get/set methods to only save thecurrent selection and not the whole collection? It will also need tosave whether it is the first render (for the use of the DefaultCountryproperty)- What behaviour to expect when an invalid countrycode is selected byconsuming (.net) code (e.g. in the DefaultCountry property)?- Is it possible to use System.Globalization to populate thecollection with country(code)'s?Thank you in advance.Hope to hear from youFreek VersteijnHere is the concept code:Imports System.ComponentModelImports System.Web.UIImports System.Web.UI.WebControls<ToolboxData("<{0}:CountrySelectorrunat=server></{0}:CountrySelector>")> Public Class CountrySelectorInherits System.Web.UI.WebControls.DropDownListProtected _DefaultCountry As String<Description("The initial country's code")> _Public Property DefaultCountry() As StringGetReturn _DefaultCountryEnd GetSet(ByVal Value As String)_DefaultCountry = ("" & Value).ToUpper()End SetEnd Property'TODO:' [ ] Move adding of items to other method?' [ ] Show DefaultCountry at first render' [ ] ViewState to only save the selected item' [ ] Use System.Globalization (RegionInfo.DisplayName or..EnglishName depending on CurrentCulture) for populating the Itemscollection if possibleProtected Overrides Sub OnPreRender(ByVal e As EventArgs)Items.Add(New ListItem("Albania", "AL"))Items.Add(New ListItem("Algeria", "DZ"))Items.Add(New ListItem("American Samoa", "AS"))Items.Add(New ListItem("Andorra", "AD"))Items.Add(New ListItem("Angola", "AO"))Items.Add(New ListItem("Anguilla", "AI"))Items.Add(New ListItem("Antarctica", "AQ"))Items.Add(New ListItem("Antigua/Barbuda", "AG"))Items.Add(New ListItem("Argentina", "AR"))Items.Add(New ListItem("Armenia", "AM"))Items.Add(New ListItem("Aruba", "AW"))Items.Add(New ListItem("Australia", "AU"))Items.Add(New ListItem("Austria", "AT"))Items.Add(New ListItem("Azerbaijan", "AZ"))Items.Add(New ListItem("Bahamas", "BS"))Items.Add(New ListItem("Bahrain", "BH"))Items.Add(New ListItem("Bangladesh", "BD"))Items.Add(New ListItem("Barbados", "BB"))Items.Add(New ListItem("Belarus", "BY"))Items.Add(New ListItem("Belgium", "BE"))Items.Add(New ListItem("Belize", "BZ"))Items.Add(New ListItem("Benin", "BJ"))Items.Add(New ListItem("Bermuda", "BM"))Items.Add(New ListItem("Bhutan", "BT"))Items.Add(New ListItem("Bolivia", "BO"))Items.Add(New ListItem("Bosnia", "BA"))Items.Add(New ListItem("Botswana", "BW"))Items.Add(New ListItem("Bouvet Island", "BV"))Items.Add(New ListItem("Brazil", "BR"))Items.Add(New ListItem("British Indian Ocean Territory","IO"))Items.Add(New ListItem("British West Indies", "WI"))Items.Add(New ListItem("Brunei Darussalam", "BN"))Items.Add(New ListItem("Bulgaria", "BG"))Items.Add(New ListItem("Burkina Faso", "BF"))Items.Add(New ListItem("Burma", "BU"))Items.Add(New ListItem("Burundi", "BI"))Items.Add(New ListItem("Cambodia", "KH"))Items.Add(New ListItem("Cameroon", "CM"))Items.Add(New ListItem("Canada", "CA"))Items.Add(New ListItem("Cape Verde", "CV"))Items.Add(New ListItem("Cayman Islands", "KY"))Items.Add(New ListItem("Central Africa", "CF"))Items.Add(New ListItem("Chad", "TD"))Items.Add(New ListItem("Chile", "CL"))Items.Add(New ListItem("China", "CN"))Items.Add(New ListItem("Christmas Island", "CX"))Items.Add(New ListItem("Cocos (Keeling) Islands", "CC"))Items.Add(New ListItem("Colombia", "CO"))Items.Add(New ListItem("Comoros", "KM"))Items.Add(New ListItem("Congo", "CG"))Items.Add(New ListItem("Cook Islands", "CK"))Items.Add(New ListItem("Costa Rica", "CR"))Items.Add(New ListItem("Cote D'Ivoire", "CI"))Items.Add(New ListItem("Croatia", "HR"))Items.Add(New ListItem("Cuba", "CU"))Items.Add(New ListItem("Cyprus", "CY"))Items.Add(New ListItem("Czech Republic", "CZ"))Items.Add(New ListItem("Denmark", "DK"))Items.Add(New ListItem("Djibouti", "DJ"))Items.Add(New ListItem("Dominica", "DM"))Items.Add(New ListItem("Dominican Republic", "DO"))Items.Add(New ListItem("East Timor", "TP"))Items.Add(New ListItem("Ecuador", "EC"))Items.Add(New ListItem("Egypt", "EG"))Items.Add(New ListItem("El Salvador", "SV"))Items.Add(New ListItem("Equatorial Guinea", "GQ"))Items.Add(New ListItem("Eritrea", "ER"))Items.Add(New ListItem("Estonia", "EE"))Items.Add(New ListItem("Ethiopia", "ET"))Items.Add(New ListItem("Faeroe Islands", "FO"))Items.Add(New ListItem("Falkland Islands", "FK"))Items.Add(New ListItem("Fiji", "FJ"))Items.Add(New ListItem("Finland", "FI"))Items.Add(New ListItem("France", "FR"))Items.Add(New ListItem("French Polynesia", "PF"))Items.Add(New ListItem("French Southern Territories", "TF"))Items.Add(New ListItem("Gabon", "GA"))Items.Add(New ListItem("Gambia", "GM"))Items.Add(New ListItem("Gaza", "XA"))Items.Add(New ListItem("Georgia", "GE"))Items.Add(New ListItem("Germany", "DE"))Items.Add(New ListItem("Ghana", "GH"))Items.Add(New ListItem("Gibraltar", "GI"))Items.Add(New ListItem("Greece", "GR"))Items.Add(New ListItem("Greenland", "GL"))Items.Add(New ListItem("Grenada", "GD"))Items.Add(New ListItem("Guadeloupe", "GP"))Items.Add(New ListItem("Guam", "GU"))Items.Add(New ListItem("Guatemala", "GT"))Items.Add(New ListItem("Guiana", "GF"))Items.Add(New ListItem("Guinea", "GN"))Items.Add(New ListItem("Guinea-Bissau", "GW"))Items.Add(New ListItem("Guyana", "GY"))Items.Add(New ListItem("Haiti", "HT"))Items.Add(New ListItem("Heard And Mcdonald Islands", "HM"))Items.Add(New ListItem("Held Territories", "XH"))Items.Add(New ListItem("Honduras", "HN"))Items.Add(New ListItem("Hong Kong", "HK"))Items.Add(New ListItem("Hungary", "HU"))Items.Add(New ListItem("Iceland", "IS"))Items.Add(New ListItem("India", "IN"))Items.Add(New ListItem("Indian Ocean Islands", "XI"))Items.Add(New ListItem("Indonesia", "ID"))Items.Add(New ListItem("Iran", "IN"))Items.Add(New ListItem("Iraq", "IQ"))Items.Add(New ListItem("Ireland", "IE"))Items.Add(New ListItem("Israel", "IL"))Items.Add(New ListItem("Italy", "IT"))Items.Add(New ListItem("Jamaica", "JM"))Items.Add(New ListItem("Japan", "JP"))Items.Add(New ListItem("Jordan", "JO"))Items.Add(New ListItem("Kazakhstan", "KZ"))Items.Add(New ListItem("Kenya", "KE"))Items.Add(New ListItem("Kiribati", "KI"))Items.Add(New ListItem("Korea", "KR"))Items.Add(New ListItem("Kuwait", "KW"))Items.Add(New ListItem("Kyrgyzstan", "KG"))Items.Add(New ListItem("Laos", "LA"))Items.Add(New ListItem("Latvia", "LV"))Items.Add(New ListItem("Lebanon", "LB"))Items.Add(New ListItem("Lesotho", "LS"))Items.Add(New ListItem("Liberia", "LR"))Items.Add(New ListItem("Libya", "LY"))Items.Add(New ListItem("Liechtenstein", "LI"))Items.Add(New ListItem("Lithuania", "LT"))Items.Add(New ListItem("Luxembourg", "LU"))Items.Add(New ListItem("Macau", "MO"))Items.Add(New ListItem("Macedonia", "MK"))Items.Add(New ListItem("Madagascar", "MG"))Items.Add(New ListItem("Malawi", "MW"))Items.Add(New ListItem("Malaysia", "MY"))Items.Add(New ListItem("Maldives", "MV"))Items.Add(New ListItem("Mali", "ML"))Items.Add(New ListItem("Malta", "MT"))Items.Add(New ListItem("Marshall Islands", "MH"))Items.Add(New ListItem("Martinique", "MQ"))Items.Add(New ListItem("Mauritania", "MR"))Items.Add(New ListItem("Mauritius", "MU"))Items.Add(New ListItem("Mayotte", "YT"))Items.Add(New ListItem("Mexico", "MX"))Items.Add(New ListItem("Micronesia", "FM"))Items.Add(New ListItem("Moldova", "MD"))Items.Add(New ListItem("Monaco", "MC"))Items.Add(New ListItem("Mongolia", "MN"))Items.Add(New ListItem("Montserrat", "MS"))Items.Add(New ListItem("Morocco", "MA"))Items.Add(New ListItem("Mozambique", "MZ"))Items.Add(New ListItem("Myanmar", "MM"))Items.Add(New ListItem("Namibia", "NA"))Items.Add(New ListItem("Nauru", "NR"))Items.Add(New ListItem("Nepal", "NP"))Items.Add(New ListItem("Netherlands", "NL"))Items.Add(New ListItem("Netherlands Antilles", "AN"))Items.Add(New ListItem("New Caledonia", "NC"))Items.Add(New ListItem("New Zealand", "NZ"))Items.Add(New ListItem("Nicaragua", "NI"))Items.Add(New ListItem("Niger", "NE"))Items.Add(New ListItem("Nigeria", "NG"))Items.Add(New ListItem("Niue", "NU"))Items.Add(New ListItem("Norfolk Island", "NF"))Items.Add(New ListItem("North Korea", "KP"))Items.Add(New ListItem("Northern Ireland", "XB"))Items.Add(New ListItem("Northern Mariana Islands", "MP"))Items.Add(New ListItem("Norway", "NO"))Items.Add(New ListItem("Oman", "OM"))Items.Add(New ListItem("Pakistan", "PK"))Items.Add(New ListItem("Palau", "PW"))Items.Add(New ListItem("Panama", "PA"))Items.Add(New ListItem("Papua New Guinea", "PG"))Items.Add(New ListItem("Paraguay", "PY"))Items.Add(New ListItem("Peru", "PE"))Items.Add(New ListItem("Philippines", "PH"))Items.Add(New ListItem("Pitcairn", "PN"))Items.Add(New ListItem("Poland", "PL"))Items.Add(New ListItem("Portugal", "PT"))Items.Add(New ListItem("Puerto Rico", "PR"))Items.Add(New ListItem("Qatar", "QA"))Items.Add(New ListItem("Reunion", "RE"))Items.Add(New ListItem("Romania", "RO"))Items.Add(New ListItem("Russia", "RU"))Items.Add(New ListItem("Rwanda", "RW"))Items.Add(New ListItem("Saint Lucia", "LC"))Items.Add(New ListItem("San Marino", "SM"))Items.Add(New ListItem("Sao Tome And Principe", "ST"))Items.Add(New ListItem("Saudi Arabia", "SA"))Items.Add(New ListItem("Scotland", "WY"))Items.Add(New ListItem("Senegal", "SN"))Items.Add(New ListItem("Seychelles", "SC"))Items.Add(New ListItem("Sierra Leone", "SL"))Items.Add(New ListItem("Singapore", "SG"))Items.Add(New ListItem("Slovak Republic", "SK"))Items.Add(New ListItem("Slovenia", "SI"))Items.Add(New ListItem("Solomon Islands", "SB"))Items.Add(New ListItem("Somalia", "SO"))Items.Add(New ListItem("South Africa", "ZA"))Items.Add(New ListItem("South Georgia", "GS"))Items.Add(New ListItem("Spain", "ES"))Items.Add(New ListItem("Sri Lanka", "LK"))Items.Add(New ListItem("St. Helena", "SH"))Items.Add(New ListItem("St. Kitts & Nevis", "KN"))Items.Add(New ListItem("St. Pierre", "PM"))Items.Add(New ListItem("St. Vincent & The Grenadines", "VC"))Items.Add(New ListItem("Sudan", "SD"))Items.Add(New ListItem("Suriname", "SR"))Items.Add(New ListItem("Svalbard And Jan Mayen Islands","SJ"))Items.Add(New ListItem("Swaziland", "SZ"))Items.Add(New ListItem("Sweden", "SE"))Items.Add(New ListItem("Switzerland", "CH"))Items.Add(New ListItem("Syria", "SY"))Items.Add(New ListItem("Taiwan", "TW"))Items.Add(New ListItem("Tajikistan", "TJ"))Items.Add(New ListItem("Tanzania", "TZ"))Items.Add(New ListItem("Thailand", "TH"))Items.Add(New ListItem("Togo", "TG"))Items.Add(New ListItem("Tokelau", "TK"))Items.Add(New ListItem("Tonga", "TO"))Items.Add(New ListItem("Trinidad And Tobago", "TT"))Items.Add(New ListItem("Tunisia", "TN"))Items.Add(New ListItem("Turkey", "TR"))Items.Add(New ListItem("Turkmenistan", "TM"))Items.Add(New ListItem("Turks And Caicos Islands", "TC"))Items.Add(New ListItem("Tuvalu", "TV"))Items.Add(New ListItem("U.S. Minor Outlying Islands", "UM"))Items.Add(New ListItem("U.S.A.", "US"))Items.Add(New ListItem("Uganda", "UG"))Items.Add(New ListItem("Ukraine", "UA"))Items.Add(New ListItem("United Arab Emirates", "AE"))Items.Add(New ListItem("United Kingdom", "GB"))Items.Add(New ListItem("Uruguay", "UY"))Items.Add(New ListItem("Uzbekistan", "UZ"))Items.Add(New ListItem("Vanuatu", "VU"))Items.Add(New ListItem("Vatican City State", "VA"))Items.Add(New ListItem("Venezuela", "VE"))Items.Add(New ListItem("Viet Nam", "VN"))Items.Add(New ListItem("Virgin Islands (British)", "VG"))Items.Add(New ListItem("Virgin Islands (U.S.)", "VI"))Items.Add(New ListItem("Wales", "WX"))Items.Add(New ListItem("Wallis And Futuna Islands", "WF"))Items.Add(New ListItem("Western Sahara", "EH"))Items.Add(New ListItem("Western Samoa", "WS"))Items.Add(New ListItem("Yemen", "YE"))Items.Add(New ListItem("Yugoslavia", "YU"))Items.Add(New ListItem("Zambia", "ZM"))Items.Add(New ListItem("Zimbabwe", "ZW"))MyBase.OnPreRender(e)End SubProtected Overrides Function SaveViewState() As ObjectEnd FunctionProtected Overrides Sub LoadViewState(ByVal savedState As Object)End SubEnd Class

View 2 Replies View Related

IF Statement Out Of Control

Apr 18, 2008

I've got an IF Statement with a mind of it's own.

Code associated with IF statement ALWAYS RUNS???

ALWAYS passing PostParentID = 0 into SP.
ALWAYS SKIPS Print Statement #2 in Messages Window.

Don€™t know if this is helpful€¦




--************* Insert Comment Summary Table Record ****************************
PRINT 'PRINT STATEMENT #1'
PRINT @PostParentID
IF (@PostParentID > 0) --AND (@CommentSummaryID = 0 OR LEN(@CommentSummaryID) = 0 OR @CommentSummaryID IS NULL)
PRINT 'PRINT STATEMENT #2'
PRINT @PostParentID
DECLARE @CommentCount int
SET @CommentCount = 1
DECLARE @LastUpdate DATETIME
SET @LastUpdate = GETDATE()
INSERT INTO [syl_CommentSummaries]
VALUES(
@PostID,
@CommentCount,
@LastUpdate)

SET @CommentSummaryID = (SELECT CommentSummaryID
FROM syl_CommentSummaries
WHERE PostID = @PostID)
SELECT @CommentSummaryID
UPDATE syl_Posts
SET CommentSummaryID = @CommentSummaryID
WHERE PostID = @PostID


Message Window Output:

PRINT STATEMENT #1
0
0

(1 row(s) affected)

(1 row(s) affected)

View 6 Replies View Related

List Control

Oct 2, 2007



I know it is possible to make a list inside another list control.My question is,what happens to tha data of the list which overlapped the main list.

For example,i have "mainList" which is the dominant list,it contains field1.Then i put "List2" inside "mainList".List2 have fieldNew.And next,i put a textbox inside "List2".But what could be the reason,why fieldNew can't be seen and only field1 appears when i typed in my expression =Fields!fieldNew. it doesn't seem to be present to the fact that both list are assigned to different dataset..

mainList -> dataSet1
List2 -> dataSet2

As for what i have observed,and correct me if im wrong,list can only be embed into a list if its function would be for grouping,but not for getting different values from different dataset..

Hope to hear from anyone..Thanks..

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved