Sql - Parameterized Query Expects The Parameter Which Was Not Supplied?


im having a problem with my code Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged [Code]... once i typed in the string in the textbox to search for an item i get this error The parameterized query '(@Parameter1 nvarchar(4000))SELECT * FROM borrow where (Departme' expects the parameter '@Parameter1', which was not supplied.""

View Answers
Very similar questions
Asp.net - SQL Queries Through .NET And JSON? stackoverflow.com

I'm trying to figure out how to do SQL queries towards an SQL 2005 Express server and format the return value to JSON. I got the queries working using this (perhaps very newbie-like) code; Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI [code]....

SQL Query Two Tables At Once And Loop Result As JSON Objects stackoverflow.com

I have a MySQL database with a table called "Locations" which looks a bit like this id | name | other parameters 1 | shop1 | blah 2 | shop2 | blah [Code].... This works, but it is inefficient calling the database through the loop, how do I avoid this?

Multiple Sql Queries? www.vbforums.com

I have a form that will have at least 3 seperate sql queries that I want to have submitted with an onclick event.

Using Variables In SQL Queries www.vbforums.com

I am a beginner when it comes to VB express. I went to the FAQ and found what looked like the answer to my question in "Database - How can I put the value of a variable/control into my SQL statement?" which said I should use thecode ...... where Field = ' " & variablename & " ' at the end of the SQL statement I am using a field defined as a nchar with 10 charecters and my variable is defined as a string. my field has been given the value "abcdefghij" so it is full to avoid confusion with spaces and even though the variable is identical and I have used the len command to check there are no hidden spaces etc. When I run the query I get no records selected. What am I doing wrong?. If I use Where Field = 'abcdefghij', ie specify the value in the SQL I get the correct records selected but this does not give me the flexibility I need

Intellisense For SQL Queries In VB.NET? www.sitepoint.com

I've added a database to one of my projects and I'm wondering how I can get intellisense for them. Basically I have no how I can query the database that I've added to the project. I know SQL fairly well, but I don't know how I can write queries within vb.net and have them display. I can get, so intellisense will probably be invaluable.

Running SQL Queries In VB.NET? www.sitepoint.com

I've created a database and I would like to write a query that uses variables from my application and perform calculations on the resulting data. I'm able to display the results of a simple query within a single table in a listbox, but I'm having trouble figuring out how to attach a sql command to a button press that queries multiple tables. Once I've been pointed in the right direction for how I can do this, I should be able to figure the sql bit out myself.

Regarding Sql Queries In Sqlcommand? forums.asp.net

the string format for update or insert commands.. cmd.CommandText = "UPDATE ATTDTABLE SET @subject=" + DropDownList1.SelectedValue + ",@faculty= " + DropDownList2.SelectedValue + ",@timing= " + DropDownList3.SelectedValue + ",@attd=++attd "; is the above way of writing the rite way?

DataSource Controls :: Sql Query Syntax For Advanced Search With Dropdownlists forums.asp.net

I want to be able to make a query from three dropdownlists but not all three have to be selected to create results. This is what I have so far : sub getdata (src as object, e as eventargs) dim strsql as string dim myconnection as oledbconnection dim mycommand as oledbcommand myconnection = new oledbconnection(ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_csrdb")) strsql ="SELECT tbl_case.Case_id, tbl_case.Title, tbl_case.Description, Tbl_Country.Country_Name, tbl_principle.Principle_Name," _ & "tbl_keyword.Keyword FROM tbl_keyword INNER JOIN ((tbl_principle INNER JOIN (Tbl_Country INNER JOIN tbl_case ON Tbl_Country.Country_Id tbl_case.country) ON tbl_principle.Principle_ID = tbl_case.Principle) INNER JOIN tbl_Usedkeywords ON tbl_case.Case_id = tbl_Usedkeywords.case) ON tbl_keyword.Keyword_id = tbl_Usedkeywords.keyword " _ & "WHERE " if  DLPrinciple.selectedindex=0 then strsql = strsql & "((tbl_principle.Principle_Name) like '%')" else if DLCountry.Selectedindex=0 then strsql = strsql & "((tbl_country.country_Name) like '%')"   else if DLKeyword.selectedindex=0 then strsql = strsql & "((tbl_keyword.Keyword) like '%')"  else strsql = strsql & "((tbl_principle.principle_Name) = '" & session("infoprinciple") & "')" + "((tbl_country.country_Name) = '" & session("infoland") & "')" + "((tbl_keyword.keyword) = '" & session("infokeyword") & "')" end if end if end if This is working perfectly with only one dropdownlist but I can not figure out how to make it work with several.

SQL Server :: How To Pass Parameter To PIVOT Query forums.asp.net

I tried to develop a dynamic pivot query with following code to avoid hard coding. I can got the 'Q1, Q2, Q3, Q4' dynamically and assigned to @(@quarter. But it cannot be passed to the pivot query. [Code]....

SQL Server :: Select Query Based On Two Fileds With Different Column forums.asp.net

This is my Table structure:-Table1 Field1        Field2     Age Dean         Chen      20          Janel         Wast       25 ann            Miller      20 I used this select statement  select Field1+' - '+Filed2 from Table1 and i binded this in dropdownlist now on selecting dropdownlist i need to show age in label. so how would be my select statement... to show age base on Filed1 and Filed2

SQL Server :: Execute Dynamic Query From The Resultset? forums.asp.net

I've a resultset that returns some 55 rows which is typically a dynamic query like [Select column_name from table_name where column = condition]. I need to execute this query which is in resultset and insert the value of column_name into another table. I dont get the way as how to make it. Kindly suggest me as how can I execute it.

Use Image Definition In SQL Query? bytes.com

i have a "for" function that create for each ip address found in the database an image button having a name="the ip address". this is the code: <?php $query = mysql_query("SELECT * FROM site_status"); $number= mysql_num_rows($query); for ($i=0; $i<$number; $i++){ [Code].....

Sql Query From Checkboxes forums.devshed.com

I'm having a Mysql database with two tables, one table person containing the personal information, and another table profile, with several columns that can be either y or n. As it is now, from a html form I can enter information in the database, and I edit a persons personal information and profile. But now I want to be able to find persons based on their profile, so I have a form with a checkbox for each column in the profile table. I want to be able to check off one or more checkboxes, and get the names and id number for the corresponding persons. But invariably I get all the persons in the database as a result. Even when I _don't check any boxes_! I include the code snippets here: Code:

Selectively Building An SQL Query www.codingforums.com

I have a form that has 4 select boxes out of which the first one is mandatory and other 3 may or may not be selected by the user. If one or more of them is selected the searching (or rather viewing) gets more specific according to that criterea. My problem is how you build the SQL for this kind of thing ? My problem is further complicated by the fact that if the user selects one or more selectives at most two tables have to be joined to get the results. So I have to get these tables to the from clause as well as in the where clause and for joining.

Returning A Two Dimensional Array From SQL Query? stackoverflow.com

Is there way to return a two dimensional array from a SQL query? Like.. "SELECT id, x, y, z FROM test" ..and have it return as id => x, y, z? I could do a loop and create a second array but I imagine that's extra work that I might not have to do. Just not familiar with SQL right now.

SQL Reporting :: SSRS URL Paramter Value Does Not Match With Report Parameter Values forums.asp.net

We have rdl report and passing a multiple paramter values through URL. When the passed values exists in report parameter values then report displayes properly. But when we pass the values through URL which doesn't exists in report parameter value then it throws an error saying parameter value is missing. The reports db and the application db through which we display the reports are different. how do we address this issue.

SQL Server :: The Multi-part Identifier "bad.towho" Could Not Be Bound forums.asp.net

I have the following query: select good.fromwho , good.applesdate, good.starttime , good.hungupfromwho from apples good where ( good.type = 1 and good.result = 2 and good.fromwho not inselect bad.towho from apples bad where bad.type = 2 and bad.result = 1 and bad.applesdate >= good.applesdate and bad.starttime > good.starttime ) What I want to be able to do is add to my top selection statement columns from the "bad" table. If I try, it gives me  The multi-part identifier "bad.towho" could not be bound. Is this possible?

SQL Server :: How To Know If Field In A Table Is Encrypted Or Not forums.asp.net

if field in a sql data table is encrypted or not ??!! like a function that return true or false>>> IsEncrypted()

SQL Reporting :: ReportViewer "View Report" Button Not Functioning? forums.asp.net

Version 9 of ReportViewer in Remote Processing mode, IE 7 or 8 my report loads correctly. The toolbar appears correctly and parameters can be changed however the View Report button does not refresh the page to reload the report with the adjusted parameters - ie clicking performs no action. I am sure this is something simple I have missed?

SQL Server :: Could Not Allocate Space For Object 'dbo.tbl_Notes' forums.asp.net

I have an storedprocedure which checks the following scenario: An email will be sent to multiple customers simulataenously. the email addresses are seperated by semi colon. I have to save that mail in  a table and then in the same procedure,  I have to check each email address and whether it is of any customer in the customer table.. If it is of customer, then i have to insert an entry in another notes table. For this i am doing the following operation in Stored procedure: [Code].... the above is the part of storedprocedure i wrote. The problem is I get an error when executing this stroed procedure in Asp.net  Could not allocate space for object 'dbo.tbl_Notes'.'PK_tbl_Notes' in database 'ProjDB' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. and following that code,  i am executing another SqlBulkCopy operation in front-end .. that returns the following error: System.Data.SqlClient.SqlException: Could not allocate a new page for database 'ProjDB' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

While Loop Not Updating Mysql Query? stackoverflow.com

Writing querys to mysql, so it is a newbie mistake, but can't figure it out.Here is the code(with lots of echos so I can show my output). Code:while($row = mysql_fetch_array($tempresult, MYSQL_ASSOC)){ $tempStartDate = $StartDate; $tempEventID = $row['EventID']; $tempDaysFromEvent = $row['DaysFromEvent']; [code]... The output looks correct it to look in the db.the issue is because $tempStartDate is a string?It is a datetime in mysql.

Mysql Query Within Foreach Loop Not Working stackoverflow.com

I have an array and I want to run a query for each item in the array Two variables come from this, volume and page number -- the volumes are contained within the array and I need to pull the respective page numbers for each volume heres my code: $volsArr = array(1, 2, 3, 4); foreach ($volsArr as $volume) { $pages = mysql_query("SELECT page FROM $table WHERE vol = '$volume' LIMIT 1"); if (!$pages) { die("Query to show fields from table failed"); } while($row = mysql_fetch_array($pages)) { $page = $row['page']; } [Code].....

SQL Server :: How To Get Notepad All Item In Sql Server Database Table Field forums.asp.net

I have one asp.net application using Sql server as back end.. in sql server database i have one table which consist two fields.. ItemName and RateI have one notepad file which consist around 700 ItemName with Rate..  So how to get this ItemName and Rate in my Table...

Forms Data Controls :: Listview Not Updating Products And Not Turning Back To Itemtemplate forums.asp.net

I have a listview showing the data, and that i will use to Show, Edit, Delete, and Insert data. I added a ASP.NET Ajax HTML Editor to the EditItem Template. I click on EDIT button and it turns into the EditItem Template, i modify the data and when i click UPDATE it does nothing. Neither updating data or turning back to ItemTemplate. Here is its code: [Code].... And the Code behind: [Code]....

LINQ Queries - Combine The First 3 Queries Into A Single Query And Place In A List? www.vbforums.com

I am writing a message system on my server, the xml is something like this <xml> <entry> <sender>[code].... my problem now i guess is 2 fold, i wish to combine the first 3 queries into a single query and place in a list or a collection or is there a way to do this with a single query that will give me my desired result?

SQL Server :: Error While Executing A Dynamic Insert Sql Storedprocedure In Sql Server 2005? forums.asp.net

assist me rectifying the error in following sql stored procedure? Sql Query:- [Code].... I have created the above Stored Procedure for inserting datas into any table but while I execute the above proceedure its throwing some error.

DataSource Controls :: Need To Check To See If Any Data Has Been Returned From The SQL Query? forums.asp.net

I am trying to run the following SQL query string strConString = ConfigurationSettings.AppSettings[ "conString" ]; myConnection = new OdbcConnection(strConString); myConnection.Open(); // open connection string strSelect= "select * from tbl_howells_product_data where title like" + "'" + strsearch + "%" +"'" + "order by product_id asc";   OdbcCommand myCommand = new OdbcCommand(strSelect, myConnection); dtrReader=myCommand.ExecuteReader(); The problem is I need to check to see if any data has been returned from the SQL query, if there are no rows/ data returned by the query then I need to display a message to say that there aren't. I know that there isn't a 'number of rows method' for the dtrReader, so does anybody know how I could do this?

SQL Server :: Insert Data Into Table Got From Other Query? forums.asp.net

I got data from different 2 tables and then this selected data trying to insert into new table. Selected data have multiple records. how may i insert selected multirows into new table which has already been created into db. Select fname, lname, Addresses.address from Persons Join Addresses on persons.ID = Addresses.PID The result for this will be multi reocords then how can i insert into new table[already created]. within StoreProcedure

SQL Server :: Query Solution One Column Convert Into Two? forums.asp.net

i have a salary table that have data like this ID EmpNo mYear Net Salary 29 3 January 2010 29217 1210 3 February 2010 29217 2052 3 March 2010 29217 3102 3 April 2010 29447 4153 3 May 2010 29447 6376 3 July 2010 28803 7231 3 August 2010 28281 7893 3 September 2010 29303 5207 3 June 2010 29197 8874 3 October 2010 29303 10076 3 November 2010 31276 11318 3 December 2010 31216 12503 3 January 2011 31266 13880 3 February 2011 31266 13414 1613 January 2011 19445 12043 1613 December 2010 19445 10563 1613 November 2010 19445 9364 1613 October 2010 18150 6163 1613 June 2010 10075 8433 1613 September 2010 18150 5154 1613 May 2010 18806 But i want to create a view like this ID EmpNo ThisMonth Previous Month mYear ThisNetSalary PreviousNetSalary Net Salary 29 3 January 2010 December 2009 January 2010 29217 0 29217 1210 3 February 2010 January 2010 February 2010 29217 29217 29217 2052 3 March 2010 February 2010 March 2010 29217 29217 29217 3102 3 April 2010 March 2010 April 2010 29447 29217 29447 4153 3 May 2010 April 2010 May 2010 29447 29447 29447 5207 3 June 2010 May 2010 June 2010 29197 29447 29197 6376 3 July 2010 June 2010 July 2010 28803 29197 28803 7231 3 August 2010 July 2010 August 2010 28281 28803 28281 7893 3 September 2010 August 2010 September 2010 29303 28281 29303 8874 3 October 2010 September 2010 October 2010 29303 29303 29303 10076 3 November 2010 October 2010 November 2010 31276 29303 31276 11318 3 December 2010 November 2010 December 2010 31216 31276 31216 12503 3 January 2011 December 2010 January 2011 31266 31216 31266 13880 3 February 2011 January 2011 February 2011 31266 31266 31266 13881 3 March 2011 February 2011 March 2011 0 31266 0 5154 1613 May 2010 April 2010 May 2010 18806 0 18806 6163 1613 June 2010 May 2010 June 2010 10075 18806 10075 8433 1613 September 2010 August 2010 September 2010 18150 10075 18150 9364 1613 October 2010 September 2010 October 2010 18150 18150 18150 10563 1613 November 2010 October 2010 November 2010 19445 18150 19445 12043 1613 December 2010 November 2010 December 2010 19445 19445 19445 13414 1613 January 2011 December 2010 January 2011 19445 19445 19445 13415 1613 February 2011 January 2011 February 2011 0 19445 0.

DataSource Controls :: Unable To Put Space To Dynamic Sql Query? forums.asp.net

i have a query like this and its running correctly SELECT  CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ' ', '') AS BIGINT) FROM    P INNER JOIN PCommunication ON P.ID = PCommunication.ID WHERE   P.Telephone IS NOT NULL AND CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ' ', '') AS BIGINT) > 5000000000 AND        PCommunication.TypesID = '7667d187-5fe1-4aaf-9e31-79761561da58' i am trying to use it with dynamic query like this but its not working @query = 'SELECT  CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ''' ''', '''''') AS BIGINT)

DataSource Controls :: Creating A Dynamic Sql Query In TableAdapter? forums.asp.net

I have a string variable "@symptomesID" thats sends a list of ID's ( 1,2,3 or 2,3,6,7,33 ) as you can see it needs to be dynamic sometimes i need te send 1 id somethings i need to send more. Problem is that in my WHERE the pk_symptomsId is a INT and is expecting a INT and not a STRING so i always get a Error and i cant figure out how to get this to work i found somewhere on the internet that someone was explaning what i need to do but i cant get it to work in my tableAdapter query http://forums.whirlpool.net.au/forum-replies-archive.cfm/928435.html this is my query: SELECT        tblDiseases.diseaseName, tblDiseases.pk_diseaseId AS diseaseID FROM            tblSymptoms INNER JOIN                          tblDiseaseSymptom ON tblSymptoms.pk_symptomsId = [code]....

SQL Server :: Turning 2 Lists, Into 1? forums.asp.net

I'm sort of new to ASP.NET. What i've done here is create a list of Newsletters seperated by University newsletters, and Alpha Newsletters. What I have now been asked to do is make these 2 lists into 1 list. I can't figure a Way to do it without designing the database? Does anyone have any ideas? Take these 2 lists and make 1? Using odsNewsletterAlpha and odsNewsletterUni to create 1 list? <h2>University Newsletters</h2> <asp:ListView class="lvUniversity" EnableViewState="true" ItemPlaceholderID="plcItem" DataSourceID="odsNewsletterUni"[code]...

Change The SQL Statment Of A Data Environments Command In Code www.xtremevbtalk.com

Hello,I have a Data Report that has a Data Enviroment as its Data Source.I am useing SQL text as the source of data for the command under the data environments connection.The SQL text I have entered directly into the DE is..SELECT * FROM TablesI would like to be able to change the SQL query from within the code prior to the report being shown. so I have been playing with the following...Dim MySQL As StringMySQL = "SELECT Title from Titles Where Title = '101 Database Exercises'"DataEnvironment1.Commands("Command1").CommandText = MySQLDataReport1.ShowWhen the report is shown it is useing the SQL query that is Typed in the Date Environment and not the one that is in the code. I have tried to leave the SQL Text empty in the DE, but then the report craps out all together.Am I going about this the right way?BTW in case you need to know, I am useing an ACCESS 2000 DB and VB 6 (SP 5)Thanks,Daniel

Help Building SQL Statement www.xtremevbtalk.com

You've helped greatly in the past, how about again?Here's the table structure:tblStudentsstudent_idstudent_nametblEventsevent_idevent_dateevent_minutestblHistoryref_numstudent_idevent_idminutes_missed1. tblStudents holds student names.2. tblEvents holds info about events (date and length in minutes)3. tblHistory records what student attended what event and how much they missed.Result set needed is:event_date, student_name, minutes_missed, SUM(minutes_missed) Note: SUM[minutes_missed) would be up to & including that event_dateWhat I have so far:SELECT fname as Student, event_date, minutes_missedFROM tblhistory, tblstudents, tbleventsWHERE tblhistory.student_id = tblstudents.student_id and tblhistory.event_id=tblevents.event_id;Any assistance would be greatly appreciated.--Gary

Link Table From .mdf (sql Srv) File Into Access Db www.access-programmers.co.uk

i have a pc which doesn't have sql server installed. is it possible to link tables from .mdf file sitting on the pc into access database?

Write Array Keys To SQL www.phpfreaks.com

I have an array of data. I want to write each key in the array to its own row in SQL. what would be the best way to accomplish this?

How To Write Code To Import Text File To SQL Using www.xtremevbtalk.com

I wanted to import data from text files (2 fields) with space delimiters to an SQL 7.0 table. I am using VB as front end, how will I write code for this ?

How To Write Code To Import Text Files To SQL Using www.vbforums.com

I wanted to import data from text files (2 fields) with space delimiters to an SQL 7.0 table. I am using VB as front end, how will I write code for this ?

Web Forms :: How To Retrieve Data Saved In Sql Db Into Checkboxlist forums.asp.net

I've used checkboxlist to insert data into the sql database... example... checkboxlist have values 1,2,3,4,5... If is select 1,3 and 5 the values stored in databse will be 1,3,5. Now i want to retrieve those values into similar checkboxlist(1,2,3,4,5), but only 1,3 and 5 saved in db should be selected, 2 and 4 unselected....

SQL Reporting :: Error In Reports: The Full Path Must Be Less Than 260 Characters Long forums.asp.net

When I call my reports from the .net program, i am getting following error Microsoft.Reporting.WebForms.ReportServerException: The path of the item 'D:/WebSites/DevelopmentWebsite/AP_reports/AP_reports/vent_Full_Div' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath) at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo() at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters) at Reportviewr.Page_Load(Object sender, EventArgs e) in d:WebSitesDevelopmentWebsiteReportviewr.aspx.cs:line 416   The path of the item 'D:/WebSites/DevelopmentWebsite/AP_reports/AP_reports/Event_Full_Div' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath

SQL Server :: Choose The Most Popular Venue? forums.asp.net

i have to choose the most popular venueselect max(count(Destination))as popular_venu from bookingthis shows me error.how do i solve this?nothr queriesselect max(count(Departure_time)from bookingwhere Departure_time>12:00:00i got error for both.please help me to sovle

SQL Server :: Stuff Available For MS SQL Similar Region In C#? forums.asp.net

Similar region in C#, is there stuff available for MS SQL?

Getting The Parameter Values Being Passed To SQL Database Via SQLDataSource Control stackoverflow.com

I have a SQLDataSource control that is calling a database stored procedure, and passing quite a large number of paramaters, and the stored proc returns records that populates a gridview control. When I walk through the code behind to determine the values being passed, is there any way that I can see exactly how the parameters are being formated and passed to the stored proc?

DataSource Controls :: How To Pull Only The Current Month Data From SQL forums.asp.net

How would you pull only the current month data from SQL?

SQL Timeout When Populating My Datalist? www.vbforums.com

I have a datalist that is populated by a users friends ordered by the date they last logged in. Here is my statement..SELECT TOP 30 ContactID, Contact_User_Name, ISNULL(LastAction,0) AS LastActive FROM COMPANY_CONTACT WHERE ContactID IN (SELECT DISTINCT ContactID FROM CONTACT_GROUPS INNER JOIN GROUPS ON CONTACT_GROUPS.GroupID=GROUPS.GroupID WHERE GROUPS.SuperID IN (SELECT SuperID FROM GROUPS INNER JOIN CONTACT_GROUPS ON GROUPS.GroupID=CONTACT_GROUPS.GroupID WHERE CONTACT_GROUPS.ContactID=@ContactID)) ORDER BY LastActive DESC Like i say it works fine in managment studio but from time to time in my live site it times out with this error System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient. I am thinking it might be something to do with the 'LastAction' column which can sometimes be null.

SQL Server :: Unable To Correct Data Formats On Host forums.asp.net

I created web pages that used an SQL database on my home computer.  That DB allowed me to use data types such as 'date' and 'time'.  But when I transferred my website to a host server, I discovered that its DB does not accept these types.  They only use 'datetime' and 'timestamp'.  I changed the tables in the DB on my computer to conform to the same format as on the host computer.  I also changed the properties to the new data types with the O/R Developer and re-published the website files to the host server. But I keep getting the same error message that states the server does not support 'date' data types whenever I execute a web page that uses that table column.  The C# code states "officetable.StartDate = DateTime.Today;" 

Forms Data Controls :: Update SQL From Gridview? forums.asp.net

I have a piece of SQL that is run when a row is selected for update within a gridview.I want to return a string value from the query.Can this be done from a Gridview SQL Sproc?

DataSource Controls :: Inside Procedure, Sql Returned Records Or Not? forums.asp.net

inside procedure, how to know a sql returned records or not?

DataSource Controls :: Select Query Not Working / Getting An Invalid Column Name Error? forums.asp.net

i have the following select staement which deosnt work, can anyone advise me whats wrong with it: string _name = ddl_Name.SelectedValue.ToString(); string cmd = "SELECT ID, Telephone FROM User_List WHERE Name = '' + _name; i keep getting an invalid column name error? and i know the syntax next to _name isnt correct. how are the single quotes meant to go?

SQL Reporting :: Sum 2 Specific Values From 1group? forums.asp.net

I'm working in SSRS, and lets say I have a matrix, and the matrix is grouped by "Customers", and "Customers" have values: "Bob", "Bill", "Ted". Each Customer has a field "Amount". If I sum the "Amount" in the group footer, it will give me the sum for "Bob", "Bill", and "Ted". If I sum in the report footer it will give me the sum for all of "Bob", "Bill", and "Ted". But lets say I only wanted the sum for "Bob" and "Ted, and not for "Bill". How can I filter the sum to include only specific values of the group?

Databases :: Form Not Submitting The Data To MS-SQL? forums.asp.net

I am building a .NET 3.5 web site with visual studio 2008 and MS SQL server 2008. I have a refrence to the database in the server explorer database.dbo, I have a form with input asp controls and a typed dataset with single data table and a strongly typed data adaptoer class. when I submit the form the data does not populate the table. contactUs.aspx [Code].... contactUs.aspx.cs [Code].... contactUs.js [Code]....

Web Forms :: Outputcache With Sql DB? forums.asp.net

I am using VS2008 with C# to create a web application. I am using output cache to improve performance. There are No of places where I had written  a function to fetch the some records from the database. Now the return of such functions will chage only if some record is added in the sql table or some record is updated. So how we can apply cache in that  so that it can detect that a new record is added and check if that record ios in the cache or not if not then it will refresh the cache.

SQL Server :: Creating A Sequence Using Visual Studio 2010 - Incremental ID forums.asp.net

I am have created SQL database by using Visual Studio 2010. I created a table for users. My question is: How can I create an ID that increases automatically? For example, ID starts by 1 and increases 2 - 3 - 4 .......

Web Platform Installer And Sql Express Database Setup stackoverflow.com

I tried to install Amplifeeder today with the Web Platform Installer. When I arrived at the database setup I had to fill out some informations like "db admin user/password" and user username/password. Using SQL Express I do not have any username/password (neither admin or user). How should I be able to install applications with the WPI and SQL Express 2008 ? Basically I had this error while trying to install in the logs: DownloadManager Error: 0 : MS Deploy exception: Microsoft.Web.Deployment.DeploymentClientServerException: The database 'AmpliFeederDB' could not be created. ---> System.Data.SqlClient.SqlException: Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.

SQL Server :: Unable To See Database From Visual Web Developer forums.asp.net

I am using Visual Web Developer 2010 Express on a web server. On the same network I have SQL Server 2008 Express installed on an SQL server. I have created a login for my web server in SQL Server like mydomainmywebserver$.In Visual Web Developer when I use Database Explorer to add a connection I am having a problem. I can see my SQLserver in the server name box but I don't any database in the Select a database name box. What is the likely reason for this? Is it an authentication problem in SQLserver?

Databases :: How To Migrate From Mysql Version - 3.23.38 To Sql Express forums.asp.net

I have an old mysql database, version - 3.23.38. I'd like to migrate from this database to ms sql express 2005. When reading through about MySQL Migration Toolkit, I found this fact - it is designed to work with MySQL versions 5.0 and higher. So, which toolkit could do for mysql version 3.23.38? Or let me know how to migrate it.

SQL Server :: Multi-part Identifier Could Not Be Bound? forums.asp.net

I found a lot of stuff on this topic but nothing that matches my problem.I'm coding a simple search function and came up with this code: Dimsql As String = "SELECT DMS_files.id, DMS_files.descriptionSV, DMS_files.description, DMS_MainCategories.categoryNameFI AS 'main', DMS_SubCategories.categoryNameFI AS 'sub' FROM [DMS_files] INNER JOIN DMS_MainCategories ON DMS_files.cid=DMS_MainCategories.id INNER JOIN DMS_SubCategories ON DMS_files.scid=DMS_SubCategories.id WHERE (DMS_files.descriptionSV LIKE '%" & str & "%' OR DMS_files.description LIKE '%" & str & "%')" If (User.Identity.IsAuthenticated = False) Then sql = sql &" AND DMS_MainCategories.allowPublicSearch = 1" End If   With this I get the error "Multi-part identifier 'DMS_MainCategories.allowPublicSearch' could not be bound". But if I put the line straight to the first string, like below, it works. Dim sql As String = "SELECT DMS_files.id, DMS_files.descriptionSV, DMS_files.description, DMS_MainCategories.categoryNameFI AS 'main', DMS_SubCategories.categoryNameFI AS 'sub' FROM [DMS_files] INNER JOIN DMS_MainCategories ON DMS_files.cid=DMS_MainCategories.id INNER JOIN DMS_SubCategories ON DMS_files.scid=DMS_SubCategories.id WHERE (DMS_files.descriptionSV LIKE '%" & str & "%' OR DMS_files.description LIKE '%" & str & "%') AND DMS_MainCategories.allowPublicSearch = 1"

SQL Server :: Set Bit Field Default Value? forums.asp.net

I am trying to add a bit field with a default value of false to an existing table using VWD 2010 Express. With the allow nulls checkbox turned off and no data in the table, any value I attempt to enter into the default value box (0,(0), ((0)), False) all produce an error when exiting the field. What's the secret?

SQL Server :: Switch Two Field Data? forums.asp.net

I pulled a fast one today.  I imported thousands of records and accidentally put the FName in the LName and the LName in the FName.  I don't have a clue how to write a SQL or TSQL that will switch them.  I do have a parameter for the SQL though.  WHERE User - System Import.on ASP.NET because this is my place for help instead of going elsewhere to a more specific type of forum just for SQL.  I do only ASP.NET VB/CS development so this is my home to find all my answers.  (99% of the time).

SQL Server :: SQL - Looping Through Fields In Each Record.? forums.asp.net

to loop through each field in a record to test for a value and then set a flag at the end of each record if an instance of this value occurs in any fields?I have a table where some fields values are have a *c*  at the beginning of the text eg  "*c* value" .  What I would like to do is run a select query off the table and at the end of each record have a field called "Change Flag" and a value of "Changed" or "No Change" depending if a *c* has been encountered. There are a number of tables to run this against all with differening numbers of fields/

SQL Server :: Taking Records Out Of Oracle And Putting Them Into A SQL Server? forums.asp.net

I was wandering if I can make this faster. I am taking records out of Oracle and putting them into a SQL Server. btw, I am inserting into the Identity column [Code]....

Pass Selected Radiobutton To Insert Parameter SQL Server? www.vbforums.com

I can do that writing to insert into code. But my manager wants me to use sqldatasource control and it's insert delete update function to work with. My old code was this Code: [code]... after than i pass fieldevent but i don't know how to do it on sqldatasource control.

SQL Server :: Concat String With Parameter In SP forums.asp.net

i have a SP [Code].... as you can see from the SP, i need save in some variable because i have to create a dynamic SQL query who select with an "or" or "AND" from web form parametersthe problem is concatenate the SP parameter to my query actually, this SP returns the string : "select * from...." and not the resultset!

SQL Reporting :: How To Display Parameter Prompt Area In Web Report Viewer forums.asp.net

I tired to create a parameterized report in Report Builder 2.0 with parameters having multiple values fetched from the database. I really liked that feature, which allows me to select the desired records from the dropdown. I uploaded the report in SSRS 2008 and I could view the reports with parameters from the Report Manager of Report server. But when the report is called through the Report Viewer, I didn't get any of the parameters displayed inside the report viewer. The only way I could found is to manually give the dropdowns in the web page and sent that values to report by setting its parameter. But at here I cannot multi-select the values. So I would like to get the exact functionality given through the report manager in the report viewer. get the report parameters in the Report Viewer of ASP.NET?

SQL Server :: Update String Inside Every Record? forums.asp.net

Inside many of my records, I have some HTML - - inside the HTML, I have a particular tag: <code> I'd like to change only that code to: <pre> But I don't want to change any other text inside any records... What sql can I use to do something like this?

SQL Server :: Show 5 Random Record From Table? forums.asp.net

i need to show for every refresh of page five categories, every time different how can i do? in SQL do not exist select RND(field)...

SQL Server :: Separate Web & Database? forums.asp.net

Currently, we have our ASP.NET applications running on windows server 2003.  All of our data resides on an IBM ISeries / AS400.  The 400 people are going to be creating massive new tables with millions of records.  Because of this, I've been asked to look into the idea of putting new ASP.NET pages on the IBM ISeries server.  This server uses APACHE.  I have read that to do this, I will need to use the Mod_Mono Apache module. I would like to come up with a list of benefits and drawbacks to this new idea.  Initially, it seems like this is a bad idea for a few reasons: Security: if a users gets unauthorized access to our local server(s), they will only have access to either DB or web server, not both. Maintainability: Microsoft ASP.NET is easier to implement on a Microsoft Windows Server. Problem Solving: I will have to first determine if an issue is due to the ISeries server, or the Apache server, or the ASP.NET application. This could be countered by saying that I would already have to determine if the issue is due to Windows server, or ASP.NET application.  However I have better experience with troubleshooting on a windows box that I am familiar with. Problem Creating: I could escentially create a problem that not only takes down the web server, but the database as well, and other RPG programs running on the ISeries. Resources: The database server will not have to server my application, it will only have to retrieve the data for it. Drivers: The windows server already contains many drivers and .DLL's that are used... will these even exist on the ISeries? How easy (if even possible) would it be to get them on the ISeries if they dont exist..? A few positive thoughts: The application will reside on the same server as the data, thus, it may be quicker at retrieving data from these millions of records in a table. This was the main point as to why I should look into this possibility. Single point of failure. We no longer have to worry about two servers going down and causing this application to be unavailable...

Quickest Way To Copy SQL Data stackoverflow.com

I wrote a console application that queries all data from a table in MS Access (I know, but I inherited it) to a SQL table. It runs every morning as a scheduled task. The fields between the two tables are not identical. Currently I select all data from the MS Access table, loop through the dataset and insert each row into the SQL table. I also write a quick log file in the process. It works, but it's not fast. I would appreciate any ideas that you may have to improve the process.

Sql - Why Causing A Runtime Error stackoverflow.com

I am trying to connect to a database on my local server. The database is called "dbtest." Of course, I have left off my actual password and replaced it with "password." This is the typical code I see on every tutorial, but it doesn't work at all. Please help. <% Dim con, rs con = Server.CreateObject("ADODB.Connection") 'I think it is something to do with this line con.Open "Provider=sqloledb;SERVER=localhost;DATABASE=dbtest;UID=administrator; PWD=password;" rs = Server.CreateObject("ADODB.Recordset") %>

SQL Server :: How To Insert Data Based On Gridview User Value On Row forums.asp.net

I have three column comes from database table(Table1) and one column is for entering data for the user let us consider it look like this  ItemNo ItemName Qty  uservalue 001       A               50       20 002       A               20       5 003       B               50   004       C               60      10 005       D               40  006       E               90      15  ........ If its 300 row from database to gridview it will show 50 record with page navigation..What i need is i need to insert data in to database table which gridview row has user value..The output of the another table(Table2) will look like this after insert ItemNo ItemName   uservalue 001       A                    20 002       A                      5   004       C                    10 006       E                    15 

SQL Server :: Cannot Insert The Value NULL Into Column ReviewDate - Table "ProrsumDB.dbo.Review" forums.asp.net

I've been working on this project which requires me to insert data into a database. Due to the complexities of the function that I am doing, it is more complex to use SqlDataSource and hence I've used the traditional method of inserting to the database. The codes are as follows: [Code].... I am not too sure why, but even though I've debugged numerous times and the data gets inserted into the database through the form view, I get this error on the page after everything is executed: Cannot insert the value NULL into column 'reviewDate', table 'ProrsumDB.dbo.Review'; column does not allow nulls. INSERT fails. The statement has been terminated. reviewDate wasn't null when I tried and there are no exception thrown.

Web Forms :: Want The User To Insert The Date In Same Format(dd-mm-yyyy) But It Will Not Happening As... forums.asp.net

I am selecting the date field in the 'dd-mm-yyyy' format by using SQL Codes(103,105...).While inserting I want the userto insert the date in same format(dd-mm-yyyy) but it will not happening as in SQL Server we need to insert the date in'mm-dd-yyyy' format.Pls send me insertion query in sql to achieve this.Pls respond me ASAP.

Forms Data Controls :: MS SQL 2005 And DataSet - Computed Column forums.asp.net

I have a datatable in MS SQL that has FirstName and LastName. In MS SQL I created a computed field called FullName that was ((rtrim([LastName])+', ')+rtrim([FirstName])) I created a DataSet and a Business Logic Layer. In my typed DataSet I saw FullName in the listing when I created it. I am able to use FullName in my webpage. I use it to populate a dropdownlist. However, now when I make changes to the Customer Table I am getting this error message (seen below) Question: Should I have created the field FullName in my MS SQL Table or should I have left it alone and somehow just added a column to the DataSet and placed an expression in the FullName column? The column "FullName" cannot be modified because it is either a computed column or is the result of a UNION operator. 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: The column "FullName" cannot be modified because it is either a computed column or is the result of a UNION operator. Source Error: [Code].... Source File: c:Users ottfarmsAppDataLocalTempTemporary ASP.NET Filesinternalauburnriverside98ea0e1f2a7f0720App_Code.lbdcba1v.2.cs    Line: 1240 Stack Trace: [Code]....

SQL Server :: How To Select Only One Row From DataSet forums.asp.net

My DataSet gives a result like this when i bind to GridView BillNo     BillStation            Amt1         Amt2       Amt3       Amt4 Hyd  1              Hyd                  100              50          50           25  2              Hyd                  100              50          50           25 Bang   2              Bang                500            100        200           50   2              Bang                500            100        200           50 Delhi  3              Delhi                  50              25          50          100  3              Delhi                  50              25          50          100 As the rows from each group is same. I want to display only the first row from each group. [Code]....

Databases :: Getting The Column From Sql Or Dataset? forums.asp.net

[Code].... This is the part where I check whether there is an output   [Code]....  Using the same sql as above, I obtain the value of the column using the datareader Am i doing it correctly because i dont get the output that i wanted

SQL Server :: How To Start Identity Column From 001 forums.asp.net

I want to konw how to start my identity column from 001? [Code].... this does not work as it still takes it froom cause 001 and 1 is the same 

SQL Server :: Set Identity To Primary Key Column? forums.asp.net

I have table with around 100 record. Now I want to set identity to primary Key column

SQL Server :: Create IDENTITY ID For Primary Key Column forums.asp.net

how can i create IDENTITY ID for primary Key column like this AAAAA AAAAB AAAAC AAAAD AAAAE . ' ' ' AAAA1 AAAA2 AAAA3 AAAA4 . . . . AAABA AAABB AAABC

SQL Server :: Database Properties Column Identity Value Will Not Accept Value Change? forums.asp.net

In the tutorial I am doing I have been requested to change a field in the colums properties of a table.  The ID column is currentl displaying NO and NO again for "is aIdentity. I can Highlight the values but cannot change to yes.  either in the properties talbe or in the properties window on the right hand side of IDE interface.  How do I change that value?

SQL Server :: Identity Column Reset When Shifting Database To Remote forums.asp.net

actually recently we just shifted our website. & now when i try to transfer database from my previous server to new remote server database.all the tables auto increment field is set to 'NO' and there is no primary key anymore.

SQL Server :: Where Is Statement In XML Explicit forums.asp.net

I've build a query, but the where statement is doing strange things. First my query: select * from ( SELECT 1 as Tag, null as Parent, row_number() OVER (ORDER BY tblOccasion.ID DESC) AS [tblOccasion!1!rownum], FROM tblOccasionwhere tblOccasion.UserID = @UserName and ((tblOccasion.MerkDesc like '%' + @search + '%')or(tblOccasion.UitvoeringDesc like '%' + @search + '%')or(tblOccasion.UitvoeringDesc like '%' + @search + '%')) ) AS A where a.[tblOccasion!1!rownum] BETWEEN (@startRowIndex) AND (@startRowIndex+@pageSize) order by a.[tblOccasion!1!MerkDesc!Element],a.[tblOccasion!1!TypeDesc!Element],a.[tblOccasion!1!UitvoeringDesc!Element] FOR XML EXPLICIT; But the result should be ordered by Merkdesc, then TypeDesc, and then as last the uitvoeringDesc. So for testing i only used the MerkDesc. The strange thing is that i get the result: BMW BMW BMW Opel Volvo But this was page 1, on page 2 (paging) you got BMW again... so he takes the first 5 rows ore something and then the order. But i like that he first orders it by MerkDesc and then picks the first 5. How can i change that, i can't add a Order by in the inline sql statement i get this error: Msg 1033, Level 15, State 1, Procedure MijnAdvertenties, Line 47 De ORDER BY-component is ongeldig in weergaven, in line functies, afgeleide tabellen en algemene tabelexpressies, tenzij ook TOP of FOR XML is opgegeven.

C# Return Identity After Insert Using SQL DB bytes.com

I need to know how to return th Id after inserting row, I can do it by many ways, but I need to know why my code doesn't work? [Code]....

MVC :: Insert Many To Many With Linq To Sql forums.asp.net

I have two Table Products(ProductID,ProductName) and Categories(CategoryID,CategoryName) with Many to many Relation Between Products and Categories ProdctsCategries(ProductID,CategoryID) How Can I Implement a view that enable user to add and Edit one prodcut to many category Using ASP.NET Mvc and LINQ TO SQL

ADO.NET :: Linq To Sql Many To Many Insert Into Database In One Transaction forums.asp.net

i have a Tag Table TagId TagName Post Table  PostId PostName TagPost Table TagId PostId How can i do a many to many insert into database in one transaction?

DataSource Controls :: Insert Dbnull With Linq To SQL? forums.asp.net

I am trying to do an update and if no selection has been made in a dropdownlist (integer) or date field I would like to insert a dbnull value. But I am new to Linq to Sql and wonder if this is possible and if so how to process. I have the following code but the DBNull.Value is giving me an error. Dim context As New SondageDataContext() Dim repondant = (From r In context.Repondants Where r.RefRepondant = iRefRepondant Select r).Single repondant.Prenom = strPrenom repondant.Nom = strNom 'dates If dtAdhesion > Date.MinValue Then repondant.DateAdhesion = dtAdhesion else repondant.DateAdhesion = DBNull.Value End If 'Integer for dropdownmenu If iOccupation <> -1 Then repondant.RefOccupation = iOccupation Else repondant.RefOccupation = DBNull.Value End If context.SubmitChanges()

SQL Server :: Deadlocked Transaction On Lock Resources forums.asp.net

I develop an application using LINQ to SQL. Recently I deploy the application on  server and starts performance testing using WAPT for 100 users. Unfortunately, 90 requests are failed while placing an order and only 10 are passed. I analyse and found that for every failed request I got an error "System Exception: Transaction (Process Id 68) was Deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

SQL Server :: C Sharp - How To Connect To Database forums.asp.net

i am writing a simple C# application with sql as my database however i am confused how to connect to my database the details are the following: Server = "BFO-PC3\BFOPC3SQL2000"; Username = "aesadmin"; Password = "adminpw"; Database = "M4200";

SQL Reporting :: How To Disable Wrap In The Cell In A Report forums.asp.net

I am in VS2008 Report rdlc Design tab and my report has drill down function. One item being drilled down on is Country. However, when user drilled down, the cell become 2 rows like this:- United States Of American I do not want it to be 2 rows but want to expand its length to make it one line on expand. In Gridview etc there is a property Wrap but when I click the cell I do not find this property in this cell property in the report designer. What can I do ?

SQL Reporting :: Enable Button To Justify Text? forums.asp.net

How can enable the button to justify text? I have it on the toolbar is disabled but .

SQL Reporting :: How To Change Text In Columns In SSRS forums.asp.net

I need to create a complex report and export it to Excel.  In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. I am new to SSRS and tried out many ways but didn't get it.

Update SQL Database Using Checkbox In Datagrid? www.vbforums.com

i have a datagrid in which i display a list of complaints lodged by some people. the fields displayed include Call Status, Call RefNo , Details Etc.. i have added a checkbox. the admin should be able to check complaints that he has read and then click on "Mark as read" and then the status of the complaint should change to "Pending" from "New" or from 0 to 1. [code]....

C# - What Is Passing Parameters To SQL stackoverflow.com

In this answer to my question of how to insert data into SQL Server he mentioned passing parameters instead of string concatenation like I currently have. Is this really necessary for security? If so, what exactly is passing parameters? When i google it I get a lot about stored procedures. Is that what I want, I do not know about stored procedures....yet. EDIT: Ok, here is what I got. It seems to update the database correctly and eventually I will change the hard coded ints to inputs from a label. confirm if how I did this is not vulnerable to any sql injection or hacks. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Data; using System.Data.Sql; using System.Data.SqlClient; public partial class Stats : System.Web.UI.Page { public SqlDataReader DataReader; public SqlCommand Command; string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES (@UID, @CL, @LL, @HL);"); //string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES ('a051fc1b-4f51-485b-a07d-0f378528974e', 2, 2, 2);"); protected void Page_Load(object sender, EventArgs e) { LabelUserID.Text = Membership.GetUser().ProviderUserKey.ToString(); } protected void Button1_Click(object sender, EventArgs e) { //connect to database MySqlConnection database = new MySqlConnection(); database.CreateConn(); //create command object Command = new SqlCommand(queryString, database.Connection); //add parameters. used to prevent sql injection Command.Parameters.Add("@UID", SqlDbType.UniqueIdentifier); Command.Parameters["@UID"].Value = Membership.GetUser().ProviderUserKey; Command.Parameters.Add("@CL", SqlDbType.Int); Command.Parameters["@CL"].Value = 9; Command.Parameters.Add("@LL", SqlDbType.Int); Command.Parameters["@LL"].Value = 9; Command.Parameters.Add("@HL", SqlDbType.Int); Command.Parameters["@HL"].Value = 9; Command.ExecuteNonQuery(); } }

AJAX :: Passing The Parameters In Sql Datasource? forums.asp.net

I have used a sql data source to connect to ORACLE. Select command is working fine, as soon as I try to provide a parameter, it doesn;t work. Getting following error " ORA-01036: illegal variable name/number" Tried searching for error message -- but It says the parameters name has to be less then 32 characters, which is what I have. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnection %>"  ProviderName="<%$ ConnectionStrings:DevConnection.ProviderName %>" SelectCommand="Select ID, Name from Employee where state = @stateid"> <SelectParameters> <asp:ControlParameter Name ="stateid"  ControlID = "drdState" PropertyName = "SelectedValue" /> </SelectParameters>

Web Forms :: Scrolling Text From SQL? forums.asp.net

wanted to create some scrolling text on a page dictated from a sql query, in html days i used marquee but this didnt seem to work, and nor do i know how to fit it into a sql query, i was a select query attached to a label would do the job,

Web Forms :: Transferring Data Between Access Database And Sql Database forums.asp.net

I want to transfer data from a access table to a sql table. Simple by clicking a button. first off all i set up and OleDbConnection and a SqlConnection in my web.config file. This is the code i use in a b button method for transfer data for 1 tab le. [code]....

Forms Data Controls :: How To Update CheckBox Checked Value To Sql Server Database?\ forums.asp.net

My Code is as follows: <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" Height="50px" Style="position: static" Width="125px"> <Fields> <asp:TemplateField HeaderText="Active" SortExpression="Active"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Active") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Active") %>' Style="position: static" />  </EditItemTemplate> <InsertItemTemplate> <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Active") %>' Style="position: static" /> </InsertItemTemplate> </asp:TemplateField> <asp:CommandField ShowInsertButton="True" /> <asp:CommandField ShowEditButton="True" /> </Fields> </asp:DetailsView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NetConnectionString %>" SelectCommand="SELECT [Id], [Active] FROM [HN_RoomMaster]" InsertCommand="INSERT INTO [HN_RoomMaster] ([Active]) VALUES (@Active)" UpdateCommand="UPDATE [HN_RoomMaster] SET [Active] = @Active WHERE [Id] = @original_Id"> <DeleteParameters> <asp:Parameter Name="original_Id" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Active" Type="String" /> <asp:Parameter Name="original_Id" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Active" Type="String" /> </InsertParameters> </asp:SqlDataSource> When I click Edit Button the CheckBox gets the value from database and gets ticked.But when I click Update Button, Value ' True ' gets updated to database. But when i try to update the same data the following error message appears near CheckBox: When casting from a number, the value must be number less than infinity.Make sure the source type is convertible to the destination type. I want to update 1 or 2 as value for the field ACTIVE. ie the CheckBox value should be 1 or 2.

SQL Reporting :: OnbuttonClick Change Report For ReportViewer - Not Working? forums.asp.net

I have a ReportViewer on page linked to Report1.rdlc. I want on buttonclick it link to Report2.rdlc and display new result accordingly. I tried below it refreshes but it does not change into Report2. Just stay as it was with Report1.rdlc.   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) ReportViewer1.LocalReport.ReportPath = "Report2.rdlc" ReportViewer1.DataBind()     End Sub