Hi, I'm new to ASP.NET 2.0. I have a sqldatasource and a formview controls on a web page and inside the formview control I have two textboxes. When I click the UPDATE button in the formview, I'd like to be able to retrieve the values of the textboxes inside the formview control and pass these values to a 'Update' SQL stored procedure defined in the Sqldatasource. Does anyone know how I can do this? Hope my question is clear. Thanks in advance. hakl
Hi I am new to asp.net world. I have a page with two formviews bound to two sqldatsources. One datasource connects to sql database and other to access. The information from both the databases is quite similar. The default mode for formview1 is edittemplate and for formview2 it is itemtemplate. I want to give the user an option to update formview1 data based on information retrevied in formview2 on a click of a button. I want to do this in code behind .cs file. I am not sure how can I access the values from formview templates e.g formview1.itemtemplate... etc? Can anyone please suggest a way to acheive this? Thanks
Guys, here is my scenario: I have 3 tables 1) Vendor 2) Service 3) Service Product Each vendor has the ability to have any number of services, all with any number of service products. How should I setup my page so I can edit/insert vendors, and tie a list of service products and services to them? My plan was to have a Formview with either a checkboxlist, or multilist (to select multiple items - but they don't work that way) and then store selected items in another table (each item selected with its own record) to hold onto the vendor id and tie it to a service id and a product id, but I was unsure how to do this. Any help would be greatly appreciated. FYI I am writing in VB.
I have a form view that I am using to insert new data into a sql express database and would like to find a way to avoid attempting to insert a record if the key already exists. is there a way to do this with the formview insert command. Everything works great until I try to add a record with an already existing value in the unique key field, then it breaks.
I've got a full text index working with a "CONTAINS" clause in the SQL. I'm looking for the character that I can place in CONTAINS(*,'WHATHERE') that will return everything. I've tried "*" and "%" but none of them will do it. Does anybody know?
I'm using quite odd combination of technology for my project, I'm using PHP and MSSQL 2000, at one certain page, I want to insert to a table where one of the column is TEXT data type, and I want to get the value from the TEXTAREA at the page, of course, with carriage return captured, I manage to get it done in MySQL, where it automatically store the carriage return keyed in by user at the TEXTAREA, while for MSSQL I no luck in finding solution for this, is there any settings I can set or I need to convert the carriage return keystroke to HTML tag at my PHP?
I have created the following trigger:CREATE TRIGGER [CreateFile] ON OutputTableFOR INSERTASDeclare @filename nvarchar(35)Declare @filecontents nvarchar(2000)Declare @strcmdshell varchar(150)SELECT @filecontents = OutputText FROM INSERTEDSELECT @filename = 'c:' + OutputFileName FROM INSERTEDSELECT @strcmdshell = 'echo '+ @filecontents+ ' >'+ @filenameexec master..xp_cmdshell @strcmdshellIt works fine as long as the column OutputText has no carriagereturns.I have used my Access2K front end to dump about ten lines of text intoOutputText, each line broken by vbcrlf so that OutputText looks like:line1testline2textline3textetc.The trigger won't fire with this text.Is there something I can do to remedy this?lq
how can i insert a carriage return when i update the field?
say i want to put the following inside a field: firstline secondline
how can i update/insert a column to have a return carriage inside it? UPDATE table SET column = 'firstline secondline'
the reason i want this is because when using a program (Solomon, by microsoft, purchasing software) to grab a field out of the database and when it displays that field in the programs textbox, i want it to be displayed on two separate lines
i tried doing UPDATE table SET column = 'firstline' + char(13) 'secondline'
but when in the solomon program, it displays an ascii character between firstline and secondline like: firstline||secondline
I am trying to write a user defined function that will allow me tostrip off the last carriage return and line feed from a text field.We have address fields stored in a text field for our ERP system andsome of them have an extra carriage return and line feed at the end ofthem. This causes havoc when we sync between our ERP system and CRMsystem. If anyone knows a way to solve this problem the help would beappreciated.Examples:Existing Text field with CR:1234 Blah Street<CR>Suite 2345<CR>Corrected Text field:1234 Blah Street<CR>Suitr 2345
I am unable to get FTS working where the column to be searched is type varchar(MAX) or Text. I can get this to work if my column to be indexed is some statically assigned array size such as varchar(1000).
For instance this works, and will return all applicable results.
CREATE TABLE [dbo].[TestHtml](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PageText] [varchar](1000) NOT NULL,
CONSTRAINT [PK_TestHtml] PRIMARY KEY CLUSTERED
SELECT * FROM TestHTML WHERE Contains(PageText, @searchterm);
And this does not. It returns zero results what so ever.
CREATE TABLE [dbo].[TestHtml](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PageText] [varchar](MAX) NOT NULL,
CONSTRAINT [PK_TestHtml] PRIMARY KEY CLUSTERED
SELECT * FROM TestHTML WHERE Contains(PageText, @searchterm);
Could someone please tell me what I need to do to enable FTS on varchar(MAX) or Text columns?
I have a FullTextSQLQuery which I am trying to search a phrase(The Multi-part identifier) on full text indexed table. I am getting expected results on running the below sql query on QA machine and PreProduction servers, but not getting the same results on our development and production servres as even though same code running.
SELECT DISTINCT TOP 50 c.case_id,c.status_id,cal.cas_details FROM g_case_action_log cal (READUNCOMMITTED) INNER JOIN g_case c (READUNCOMMITTED) ON (cal.case_id = c.case_id) INNER JOIN CONTAINSTABLE(es.g_case_action_log, cas_details, ' "The multi-part identifier" OR "<br>The multi-part identifier" OR "The multi-part identifier<br>" ') as key_tbl ON cal.log_id = key_tbl.[key] ORDER By c.case_id DESC
We are using SqlServer 2008 R2 version on all servers.
I have written this sample query to search a full-text indexed table and return the results. If the word occurs more than once I want it to return as a new record and the results show a short summary of the location. I was using 'like', but the full table scans were really slowing it down. Can performance be improved for the following (The results returned by my query are accurate)
I am using the following plumbing code to search a database column for a keyword. I can't use full-test indexing so I came up w/ this work around. But It has many flaws so I'm looking for a better way. Thx in advance.
'Open sql connection SqlConnection1.Open()
Dim datareader2 As SqlClient.SqlDataReader datareader2 = cmdFindRowsWithKeyword.ExecuteReader Dim strMsg As String Dim intRowToFlag As Integer Dim strRowsToGet As String Dim strKeywordAsTyped As String Dim strKeywordAllCaps As String Dim strKeywordAllLower As String Dim strKeywordFirstLetterCap As String Dim FirstLetter As String
'Assign keyword as typed to variable strKeywordAsTyped = txtSearchFor.Text 'Assign keyword as typed to variable then convert it to all uppercase strKeywordAllCaps = txtSearchFor.Text strKeywordAllCaps = strKeywordAllCaps.ToUpper 'Assign keyword as typed to variable then convert it to all lowercase strKeywordAllLower = txtSearchFor.Text strKeywordAllLower = strKeywordAllLower.ToLower 'Assign keyword as typed to variable then convert it so just the first letter is in uppercase strKeywordFirstLetterCap = txtSearchFor.Text FirstLetter = strKeywordFirstLetterCap.Chars(0) FirstLetter = FirstLetter.ToUpper strKeywordFirstLetterCap = strKeywordFirstLetterCap.Remove(0, 1) strKeywordFirstLetterCap = strKeywordFirstLetterCap.Insert(0, FirstLetter)
'If the string contains the keyword as typed in all caps all lowercase or w/ the 1st letter in caps then flag that row. If strMsg.IndexOf(strKeywordAsTyped) <> -1 Or strMsg.IndexOf(strKeywordAllCaps) <> -1 Or strMsg.IndexOf(strKeywordAllLower) <> -1 Or strMsg.IndexOf(strKeywordFirstLetterCap) <> -1 Then
cmdFlagRowsWithKeyword.Parameters("@recid").Value = intRowToFlag SqlConnection2.Open() Dim datareader3 As SqlClient.SqlDataReader datareader3 = cmdFlagRowsWithKeyword.ExecuteReader datareader3.Close() SqlConnection2.Close()
I have a SQL SERVER database which has Articles Table. This table contains "Description" field which is of type "text". I am trying to insert 800- 1000 words of data into this field. This data also contains code snippets. I dont know for some reason it only inserts one or two lines and thats it. No error is being thrown. I am using multiline textbox to enter the data into the database. any ideas
It displays something like this:
test 1
By AzamSharp
Creating XML Men // This is very long text. Actually its the whole article but it only displays three words
I have a SQL Server database. The data from a table is populated in the table and can do a regular display query on a record without issue.
Problem is when I pull the data into a form the data doesn't show up in some form fields for editing.
I am building a backend for the manager to make updates and changes and this is vital. Does anyone know if it has something to do with a database setting or has had a similar issue in the past?
The reason I think its a database setting is becuase the same table converted into MS Access has no problem populating the text boxs and text areas.
We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message
System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)
Please note we left the DataBaseA in the old SQL2000 server.
Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup
I'm new to sql 2005 and recently installed the 180 day 2005 Enterprise Eval Product, when i click Help About in the SQL Mgnt Screen it says i have 25 days untill it expires.
The system has been setup by a freelance SQL contractor and its now live and fully working.
So i now have bought SQL 2005 Standard software and need to activate the eval product but cant figure out how to do this.
Can someone please explain my best solution here on how i can activate/license this system without loosing my data.
Hi All, I've just downloaded and installed the evaluation version of msql2005, it all seemed to go ok apart from a message towards the end of the install saying the event log was full. I cleared it an the install finished. Problem is I don't have the server manager on my menu, nor kind I find any way to run it
HiI'm using SQLDataSource declarative data access with stored procedures (Select, Insert, Update, Delete). I need to display ReadOnly, Insert or Edit FormView DefaultMode from my FormView depending on whether or not the authenticated UserId is present in the Select stored procedure reference table. The scenario - during registration the new registrant may or may not complete a data entry step. If not that user must enter data on the given form before other site related functions can be accessed. Additionally, once these values are entered they may need to be changed. Any ideas?Thanks a lot.John
How can I generate the following command with VB Code Behind in NET 2.0 and have a FormView access the command. The 4 and 20 below may be 3 and 100 and etc."SELECT * FROM [Solution] WHERE ([SolutionID] IN ('4', '20'))" The List is generated by two multiselect controls (ListBox and CheckBoxList) and a text box used to search a description field in VB code behind (ASPX.VB) This post is a summary of a previous post not responded to. Sincerely,Unhistoric
Hello all! I am kinda new to this ASP.NET world! I have a website that requires daily updates! initially i was updating my database (MSSQL) manually, but now after watching videos from viseo section of this site i thought it would be better if i use formview to update , delete or edit my data! It all worked fine for me on my local machine! but when i deployed it on my server. I was able to add new records but when i tried to update an existing record or delete some record i got this error message...
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Please i know this problem is perhaps because of a very little mistake i may have done but i am going nuts because of it! please tell me what i have done wrong!
I have a quick question regarding getting data from a SQL database but I am slightly confused as to the best way to handle it.
Basically on of the projects I am working on I need to send data to another company, there are several calls required to the database to bring back various options for changing the questions asked on the front end.
Up to now all that has happened is there has been a mutual agreement between myself and this other company and they have just had access to the database to call a series of stored procs which I have written for them to access the data. Recently however the situation has changed and my client wants me stop them accessing the database however they still need to recieve the information from the database they recieve now.
What will be the best way to handle this? My knowledge of SQL is farily limited presently and I am only ust getting into learning a lot more about it.
I had SQL Server 2005 Express originally installed and then I installed the 2005 Enterpsie 180 day Eval and for some reason I cannot get the Management Console that lets me schedule tasks to show up and the ability to do imports. The only Management console I can get to show up is that useless Management Console Express to show up. I have tried reinstalling countless times, how can I get the Management console included with the Enterprise 180 eval to show up, it seems to have been included in the install, but there are no links in the start menu for it, just the configuration tools anybody...please!
I can't get the following SQL to compile/run: ----- DECLARE @strTableName varchar(50) DECLARE @strFieldName varchar(50) DECLARE @intCount int
SET @strTableName = 'Customer' SET @strFieldName = 'AddDate'
SET @intCount = (SELECT Count(DISTINCT '+@strFieldName+' FROM '+@strTableName+') ----- I receive the the following error: Incorrect syntax near '+@strTableName+'
But why? It works if I hard-code the tablename & fieldname strings into the SELECT statement, but not when I replace them with the variables. Any help will be greatly appreciated. Thanks! Jeff
We had a evaluation copy of SQL 6.5 loaded on a server. The eval has expired and I need the server back. We have plenty of SQLServer fully licensed versions available. How do I upgrade this without losing my existing server.
I have a database running on what transpires to be an evaluation copy of SQL 6.5 which has expired. How can I install a full licenced copy of 6.5 whilst retaining databases, users etc. Note:when starting the SQL server service it immediately shuts down due to the eval expiry. Any help is greatly appreciated.
OK.. I've got a stored procedure I'm writing, which accepts an argument called @statfield... let's say I want to use this variable as a literal part of a SQL statement, example:
select * from table1 where @statfield = @value
I want to do basically an eval(@statfield) so if @statfield is "key_id", then the select statement comes out:
Alright here's my situation. I have two servers both running Eval copies of SQL Server 2005 Enterprise. This is only because I had the promise that I would be getting a shiney new server with a fully licensed copy of the server soon so I wasn't worried when I setup these two programs to use these. Now they are dragging their feet to approve the server and software so I'm scared. First question - What will happen when the eval period runs out? Second question - Can I tell what the date was when I installed the server?
These both will help me push management to approve atleast the purchase of an SQL license if I can't get the server.