CountrySelector Control

Jul 20, 2005

Hello all

I am developing a CountrySelector control (which I would like to share
with anyone), but I am quite a newby in this custom control area.

You can find it at:
http://home.kabelfoon.nl/~juliusd/v...ntrySelector.vb

Some 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 is
enabled. Best would be if the items show up in the designer already
but only in designmode and not with <ListItem> in the HTML source.
- How can I override ViewState get/set methods to only save the
current selection and not the whole collection? It will also need to
save whether it is the first render (for the use of the DefaultCountry
property)
- What behaviour to expect when an invalid countrycode is selected by
consuming (.net) code (e.g. in the DefaultCountry property)?
- Is it possible to use System.Globalization to populate the
collection with country(code)'s?

Thank you in advance.

Hope to hear from you

Freek Versteijn



Here is the concept code:



Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls

<ToolboxData("<{0}:CountrySelector
runat=server></{0}:CountrySelector>")> Public Class CountrySelector
Inherits System.Web.UI.WebControls.DropDownList
Protected _DefaultCountry As String

<Description("The initial country's code")> _
Public Property DefaultCountry() As String
Get
Return _DefaultCountry
End Get
Set(ByVal Value As String)
_DefaultCountry = ("" & Value).ToUpper()
End Set
End 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 Items
collection if possible

Protected 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 Sub

Protected Overrides Function SaveViewState() As Object

End Function

Protected Overrides Sub LoadViewState(ByVal savedState As Object)

End Sub
End Class

View 2 Replies


ADVERTISEMENT

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

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 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

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

Lookup Control

Nov 19, 2007



Hello,

I am using Lookup Item in the Data flow of the SSIS tool.

During my data flow this task is failing because can not find a match.

Please let me know how can I say - if there is no match - use the default value like 0.

Is it possible to do using Lookup?

Thanks.

View 11 Replies View Related

Concurrency Control

Mar 5, 2008

I created an ETL Process which loads four different types of files into different tables in parallel. There is no issue with this parallelism as the sources and destinations are distinct. But I have a common log table where I log the status and timings of each load for any file type. When ever I start a new file load, I create an entry in this log table with the FileTypeID and LoadInProcess as 1 (this will be set to 0 for all other records of the same file type). At different stages of the load, I will pull the active LoadID of the current file type and update the same record with the timings and results. My code looks like this -





Code Snippet
SELECT

@LoadLogKey = LoadLogKey
FROM

SystemLoadLog (NOLOCK)
WHERE

FileTypeID = 1 and LoadInProcess = 1


IF @LoadLogKey is NULL

RAISERROR('Unable to retrive LoadLogKey for the current load!')

***Process1 Query
***Process2 Query
***Process3 Query

UPDATE

SystemLoadLog
SET

Process1Result = x,
Process2Result = y,
Process3Result =z
WHERE

LoadLogKey = @LoadLogKey






The first SELECT query is giving problems as different processes are using the same table to log the results and timings. The source files I load are too small that the data load finished in 1 or 2 seconds most of the time and within this timespan, I update the log atleast 10 times. So, if four different file types are loading, the hits to the SystemLoadLog can be as bad as 20 to 30 times in 1 second.

Can anyone let me know how to handle this?

Thanks in Advance!!!
Harish

View 3 Replies View Related

Regarding Chart Control

Mar 3, 2008



Hi All,

I have got a query regarding SSRS report chart control. Can i have a chart with both bars and lines within it?

I have a dataset which has two columns as my outputs.Can i have a chart showing bars for one column and line chart for the other column in the same chart?

I will appreciate if somebody can help me out.

Dinesh

View 3 Replies View Related

Matrix Control

Dec 19, 2006

Hi all,

I'm using matrix control as my reporting tools.

But i found one trouble, how can i do my matrix become like this.








Product A

Product B


Customer

Price

Qty

Price

Qty


Customer A

10

10

140

160


Customer B

12

120

120

160


Customer C

10

10

110

140

The price and qty is the static column, and i would like to make the static row also. (show in red color) but i can't.

Please help...

Thanks

Kendy

View 11 Replies View Related

Error Control

Aug 30, 2007



hi,
I'm trying to insert files from one table to anotherone. The problem is that the source table doesnt have any primary key, and it has duplicated PK that the destination needs to be unique. It's possible to ignore this kind of errors? I am using an OLEDB Destination transformation, and trying to omit this error configuring the error output, but it doesnt work.


Thanks!

View 6 Replies View Related

About Control Flow

Apr 20, 2008

I am new to SSIS can anyone tell me the diff between control flow and dataflow. if all the transformation are done using dataflow than why do we use control flow. Sorry if I am asking you very basic question.

View 5 Replies View Related

How To Use Reportviewer Control

Jun 15, 2007

Hi,



I have couple of reports designed and they are on the report server and those reports are driven using some strored procedures.



I am building a asp.net program and want to use the reportviewer control in it, and i was wondering if there is any way that i could reference the reports thats been created usiing BIDS and use them in report viewer, or do i have to build them from scratch.



Any ideas pls?



Regards

Karen

View 9 Replies View Related







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