How To Store A Multi-line Textbox In MS SQL?

Feb 28, 2008

Hello,
I'm a newbie and I have a little problem that's starting to work on my nerves
 
I want to store a multi line textbox in the database, just like the way it has been entered.

I used a varbinary-field.
This is my code in my aspx
                Dim myOptions As New InterTyp.Opties()
                Dim myCon As SqlConnection = myOptions.getCon()
                Dim cmdOef As SqlCommand
                Dim parmOef As SqlParameter
               
                cmdOef = New SqlCommand("GetOef", myCon)
                cmdOef.CommandType = CommandType.StoredProcedure
                cmdOef.Parameters.Add("@oid", System.Data.SqlDbType.Int).Value = ID

                'output
                parmOef = cmdOef.Parameters.Add("@otext", SqlDbType.VarChar)
                parmOef.Size = 8000
                parmOef.Direction = ParameterDirection.Output

                'execute the query
                myCon.Open()
                cmdOef.ExecuteNonQuery()
                txtOef.Text = cmdOef.Parameters("@otext").Value
                myCon.Close()
In my code i call a sp:
CREATE PROCEDURE dbo.GetOef
             @oid integer,
             @otext varchar Output
AS
             SELECT  otext
             FROM oefening
             WHERE     (oid = @oid)
 
So my problem is:
How do i cast the varbinary back to a text?

 
 

 

View 2 Replies


ADVERTISEMENT

Storing And Retrieving Line Breaks/newlines From Multi-line Textbox (C#)

Aug 31, 2007

I hope I'm posting this in the correct forum (forgive me if I'm not) since I'm not sure if this is an issue with inserting an item into a db or the processing of what I get out of it.  I wrote a basic commenting system in which someone my post a comment about something written on the site.  I wanted to keep it very simple, but I at least want the ability for a user to have newlines in their comment without having to hardcode a <br /> or something like that.  Is there a way for me to detect a newline if someone, for example, is going to their next paragraph?
Let me know if you need a better explanation.
Thanks in advance!

View 4 Replies View Related

How To Monitor Store Procedure (Line By Line)

Sep 29, 2001

HEllo can anybody tell me how to monitor a long store procedure
line by line. Also how to put progress bar in it to tell user how
much is done.

Sabih.

View 1 Replies View Related

Display Multi Value Parameters In Textbox

Jun 8, 2007

Hello,



I have the following problem.

i have a report where you need to fill in a few parameters

start date, end date and subject selection.

the subject selection is a multivalue paramter (select all, param1, param2, param3)

the multivalue parameter is based on another dataset with paramid as value field and paramdescription as value label.



in my report i want to display something like this :

from startdate to enddate

summary for campaign(s) : selected parameters.



in the selected parameters is can display a =join(Parameter!campaig.value) but this only returns the 32bit guid.

instead i would like it to display the parameterdescription label.



anybody has some ideas ?



greetings

vince

View 1 Replies View Related

Reporting Services :: Double Line Spacing In Large Textbox In SSRS

Mar 3, 2010

How do I achieve double spacing of lines in a large text box in SSRS?

View 6 Replies View Related

Getting Results With Stored Procedure From Single Textbox Searching Table With Multi Columns

Feb 12, 2007

I admit I am a novice to queries and stored procedures but understand stored procedures are more secure, so I am choosing to challenge myself with a stored procedure and have not been successful at all.

What I am looking for is a stored procedure which would query the single table named Hospital, which would search from a single textbox the end user would enter the text they are searching for on a Windows VB application but is dependant on a few end user selected items.

1. The end user can select a radio button either "Starts with" or "Contains"
2. The end user can select from 6 checkboxes (Hospitals, Address, City, State, Zip, Type) to limit or expand their search from the columns in the table.

The table has 17columns (CO, PARENTCO, ADDR, POBox, CITY, State, ZIP, TEL, FAX, WEBSITE, HOSP_TYPE, OWNERSHIP, BEDS, CONTACT, TITLE, Email) but I am only allowing the end user to search by the above 6 columns and need to display the above 6 columns plus the phone, fax and website columns.


After the user clicks the search button it displays the results in a listbox and the user will then select the one they want and it displays the information in another set of textboxes.

Hopefully someone can get me pointed in the right direction! Thanks for your help!

View 12 Replies View Related

Getting Value From Multi-Line Text Box

Sep 28, 2004

Hi,
I have a Multiline Textbox in my application.The value from the textbox is updates in a SQL
table.The problem i have is
If I type in the textbox 1211 London street Sussex <br> UK <br>Europe ,only 1211 London street Sussex gets into the table.Anything I type after the "Enter " doesnot go into the table.

I checked the field sizes in my stored procedure and they are varchar(500) .

Any ideas

View 4 Replies View Related

Multi-line Annotation?

Aug 30, 2005

Is it not possible to have a multi-line annotation OR my ENTER key is stuck ;-)

View 7 Replies View Related

Multi Line Rows

Jul 10, 2006

Using Visual basic 2005

I have a form and set up my datasource, bindings etc.

All works well, adding, updating, and deleting via form to sqlexpress except.....

I have 2 columns set up in sqlserver that get data from muliline textboxes on my form.

Column 1 "Material" is nvarchar(50)

Column 2 "Quantity" is int

The first multine textbox "Material" works fine, eather updating in the textbox or in the Datagridview cell.

the second multiline textbox "Quantity" works when I just put in a number in the first line of the multiline textbox, when I put in the 2nd number on the second line, nothing gets updated.

I I do that in the datagridview cell (Shift-Enter), I get an error.

"System string was not in correct format".

I tried integer.parse, but that dosn't work. I'm assuming it has something to do with the next line ascii code or something like that.

Can anyone out there help with this

View 3 Replies View Related

Multi-line Chart Title

Apr 23, 2007

Good day,



Is there anyway that I can have a multi-line chart title? I have even tried placing a text box over the title part of the chart that is multi-line, although this appears to work once the report is deplyed and viewed in a web browser the text box appears below the chart and the chart then has no title.



Please can you help?

View 2 Replies View Related

T-SQL (SS2K8) :: Update Table With Multi-line Comments?

Apr 14, 2014

How to update column with multiline comments.

eg. I need to update Notification column in my table as below.

Exit Formalities Notification sent to:

Employee: LastName, FirstName
EmployeeEmail: EmployeeEmailAddress

View 4 Replies View Related

Executing Multi-lines SQL Scripts From Command-line

Jul 20, 2005

Hello,I'm trying to execute a file containing few SQL statements.CREATE VIEW test1 AS SELECT * FROM table1;CREATE VIEW test2 AS SELECT * FROM table2;The standard SQL way is to end a statement with semi-colon.But doing that,it doesn't work in SQL Server.After changing ";" to "GO", it works fine.Is there anyway we can stick to ";" to indicate the end of statement.I don't want to create scripts which works only in SQL Server.Please comment.Thanks in advance.

View 3 Replies View Related

SQL HELP! Msg 4104, Level 16, State 1, Line 1 - The Multi-part Identifier Error

Sep 7, 2006

Hi chaps,

I have the following SQL query (SQL 2005).
Its basically retrieving some values using simple joins.
However there appears to be a problem with the LEFT OUTER JOIN:
"LEFT OUTER JOIN DDDispatchedOrder ON (OrderLineItemTransaction.OrderLineItemTransaction ID = DDDispatchedOrder.OrderItemTransactionID)
"
When I try to compile the code i Get :
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "OrderLineItemTransaction.OrderLineItemTransactionI D" could not be bound.

Any help would be appreciated.

Cheers
Bal

SELECT
ord.orderDate,
cc.forename + ' ' + cc.surname person,
prod.description,
oli.noofitems,
deladdr.housenameno + ' ' + deladdr.addressLine1 + ' ' + deladdr.addressLine2 + ' ' + deladdr.city + ' ' + deladdr.postcode + ' ' + deladdr.county + ' ' + deladdr.country deladdress
FROM
product prod,
OrderLineItem oli,
[Order] ord,
OrderTransaction ordT,
OrderLineItemTransaction oliT,
CustomerContact cc,
Customer cust,
DDDispatchedOrder dd,
address deladdr,
address invaddr
LEFT OUTER JOIN DDDispatchedOrder ON (OrderLineItemTransaction.OrderLineItemTransaction ID = DDDispatchedOrder.OrderItemTransactionID)
WHERE
prod.productID = oli.productID:eek:
AND ord.orderID = oli.orderID
AND ord.orderID = ordT.orderID
AND oliT.orderlineitemID = oli.orderlineitemID
AND cc.customercontactID = ord.customercontactID
AND cc.customerID = cust.customerID
AND ord.invoiceaddressID = invaddr.addressID
AND ord.deliveryaddressID = deladdr.addressID
AND ordT.dispatchTypeID = 2

View 7 Replies View Related

SQL Server 2012 :: Store Multi Values In One Parameter?

Sep 29, 2015

i design SP for insert data in 2 tables i need to store list of array in one parameter to complete my query i try the table value but it`s not good for me because table value is readonly and i need to insert data with list of array .....

View 5 Replies View Related

Multi Connection To .sdf File Store On Network Share

Feb 22, 2007

Hi

In the "Choosing Between SQL Server 2005 Compact Edition and SQL Server 2005 Express Edition" white paper, i can read that: "SQL Server 2005 Compact Edition support data file storage on a network share" and "Number of concurrent connections = 256"

But when i try to connect with two different PC at the same time to a .sdf file store on a network share, i have an error message : "File is locked by an other processus"

The firsth PC is connected but the secondth can't

";Mode=Read Write" in the connection string don't change anything.

anybody have an idea ?

View 3 Replies View Related

Store Multi-Select Values In An Image Data Type?

Dec 20, 2005

I was working on figuring out where a certain application wasstoring the multiple selection choices I was doing through the app.I finally figured out that they were being store in an IMAGEdata type colum with the variable length of 26 bytes.This is the first time I ran into such way of storing multipleselections in a single Image data type.Is this a better alternative than to store into a One-to-Manytables? If so then I'll have to consider using the Image datatype approach next time I have to do something like storing1 to thousands of selections.Thank you

View 4 Replies View Related

How To Refer To Report Textbox Values In Another Textbox

May 24, 2007

I want to add up the values in a couple of text boxes in another textbox. How do I refer to the textboxes?



fields!textbox1.value doesn't work..what does?

View 1 Replies View Related

How Can I Remove The Line Feed/carriage Return In The Last Line Of The Exported Text File ?

Feb 27, 2007

Hi,
for some AP issue, the file I upload must be without the line feed/carriage return in the last line.
for example:

original fixed-length file (exported from SSIS)
line NO DATA
1 AA123456 50 60
2 BB123456 30 40
3 CC123456 80 90
4 <-- with line feed/carriage return in the last line

The file format that AP request. The file only has 3 records, so it should end in the third line.
line NO DATA
1 AA123456 50 60
2 BB123456 30 40
3 CC123456 80 90

Should I use script component to do it ? I am new for VB . Anyone would help me ?

Thank you all.

View 1 Replies View Related

Reporting Services :: Draw Trend Line For SSRS Line Chart 2005

May 4, 2012

I need the Trend line for the following data in Line chart they are the following data. The following are the graph are my output and i need the trend line for these Key_gap value.

This is the link [URL] ....

I need the same trend line for the Bar-Chart in SSRS 2005.

View 5 Replies View Related

ISQL: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect Syntax Near ' '

Nov 8, 2006

G'day everyoneThat's a space between the ticks.It's all part of a longer script but seeing as the failure occurs online 1if exists (select * from dbo.sysobjects where id =object_id(N'[dbo].[config]') and OBJECTPROPERTY(id, N'IsUserTable') =1)drop table [dbo].[config]GOThat's three lines only. Does it matter that they're in Unicode?Any ideas?Kind regards,Bruce M. AxtensSoftware EngineerStrapper Technologies

View 3 Replies View Related

Displaying A Trend Line (in Line Chart) In SSRS

Feb 7, 2007

We have a line graph which plots the actual data points (x,y), everything is working fine with this graph. Now we need to add a trend line to this existing graph after going thro. the articles we came to know that there is no direct option in SSRS to draw a trend line. So we need to calculate the trend values ourselves which we need to plot as atrend line. This trend line is similar to the trend line which comes in Excel chart, do anyone know how to calculate the trend values from the actual data points. We got through several formulas, but were not clear, have anyone tried out exactly the same, if so please help us out by providing an example to calculate the trend values.

View 1 Replies View Related

Dynamically Change The Color Of The Line On A Line Graph

Oct 26, 2007

I have a line graph which shows positive and negative values. Is it possible to have the line one color when its negative and another when its positive?

kam

View 4 Replies View Related

Reference Textbox In Other Textbox

Sep 12, 2007

Hi!
I dont know if i will explain this correctly, but my problem is with reporting service.
I'm supposed to Sum value in one textbox and than that sum use it in sum in other textbox.

Something like this:
Sum(Fields!Abc.Value/(Fields!dfg.Value+Sum(Fields!abc.Value)),"matrix1_RowGroup1")*100
I get error msg 'The Value expression for the textbox 'textbox49' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.'

Something like this wont work either Sum(Fields!abc.Value/ReportItems("textbox56").Value)*100
Error The Value expression for the textbox 'textbox55' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers.

So, pls help if you know how to reference textbox in other in body of report.
Thx.

View 1 Replies View Related

SQL 2012 :: Disaster Recovery Options For Multi-Database Multi-Instance Environment

Sep 23, 2014

Disaster Recovery Options based on the following criteria.

--Currently running SQL 2012 standard edition
--We have 18000 databases (same schema across databases)- majority of databases are less than 2gb-- across 64 instances approximately
--Recovery needs to happen within 1 hour (Not sure that this is realistic
-- We are building a new data center and building dr from the ground up.

What I have looked into is:

1. Transactional Replication: Too Much Data Not viable
2. AlwaysOn Availability Groups (Need enterprise) Again too many databases and would have to upgrade all instances
3. Log Shipping is a viable option and the only one I can come up with that would work right now. Might be a management nightmare but with this many databases probably all options with be a nightmare.

View 1 Replies View Related

SQL 2012 :: MSDTC In Multi-node / Multi-instanced Cluster

Aug 17, 2015

More often than not, I typically don't touch DTC on clusters anymore; however on a project where the vendor states that it's required. So a couple things here.

1) Do you really need DTC per instance or one for all?
2) Should DTC be in its own resource group or within the instance's group?
2a) If in it's own resource group, how do you tie an instance to an outside resource group? tmMappingSet right?

View 9 Replies View Related

The Multi Delete &&amp; Multi Update - Stored Procedure Not Work Ok

Feb 4, 2008

the stored procedure don't delete all the records
need help



Code Snippet
DECLARE @empid varchar(500)
set @empid ='55329429,58830803,309128726,55696314'
DELETE FROM [Table_1]
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0




TNX

View 2 Replies View Related

BIDS Line Charts - Cant Remove Line?

Dec 12, 2007

Hi,

When creating a line chart, I would like to be able to show Markers for the data points, but no line between these points (as you can do in excel).

I have set the line setting to none (for the lines of interest), however the lines still show.

Is this a bug, or am i missing something obvious settings-wise?

Cheers,

M

View 7 Replies View Related

Help With Multi Join Or Multi Tier Select.

Jul 20, 2005

Hello,I am trying to construct a query across 5 tables but primarily 3tables. Plan, Provider, ProviderLocation are the three primary tablesthe other tables are lookup tables for values the other tables.PlanID is the primary in Plan andPlanProviderProviderLocationLookups---------------------------------------------PlanIDProviderIDProviderIDLookupTypePlanNamePlanIDProviderStatusLookupKeyRegionIDLastName...LookupValue....FirstName...Given a PlanID I want all the Providers with a ProviderStatus = 0I can get the query to work just fine if there are records but what Iwant is if there are no records then I at least want one record withthe Plan information. Here is a sample of the Query:SELECT pln.PlanName, pln.PlanID, l3.LookupValue as Region,p.ProviderID, p.SSNEIN, pl.DisplayLocationOnPCP,pl.NoDisplayDate, pl.ProviderStatus, pl.InvalidDate,l1.LookupValue as ReasonMain, l2.LookupValue as ReasonSub,pl.InvalidDataFROM Plans plnINNER JOIN Lookups l3 ON l3.LookupType = 'REGN'AND pln.RegionID = l3.Lookupkeyleft outer JOIN Provider p ON pln.PlanID = p.PlanIDleft outer JOIN ProviderLocation pl ON p.ProviderID = pl.ProviderIDleft outer JOIN Lookups l1 ON l1.LookupType = 'PLRM'AND pl.ReasonMain = l1.LookupKeyleft outer JOIN Lookups l2 ON l2.LookupType = 'PLX1'AND pl.ReasonSub = l2.LookupkeyWHERE pln.PlanID = '123456789' AND pl.ProviderStatus = 0ORDER BY p.PlanID, p.ProviderID, pl.SiteLocationNumI know the problew the ProviderStatus on the Where clause is keepingany records from being returned but I'm not good enough at this toanother select.Can anybody give me some suggestions?ThanksDavid

View 5 Replies View Related

Line 1: Incorrect Syntax Near '-'. But There Is No '-' In First Line!

Dec 28, 2007

  HiIt's my stored procedure 1 CREATE PROCEDURE singleSearch2
2 @SQ nvarchar(30),
3 @pType nvarchar(11),
4 @pCol nvarchar(11)
5 AS
6 BEGIN
7 DECLARE @SQL NVarChar(1000)
8 SELECT @SQL='SELECT *,'
9 SELECT @SQL=@SQL+' CASE RTRIM(LTRIM(op))'
10 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'e'+CHAR(39)+' THEN '+CHAR(39)+'اجاره'+ CHAR(39)
11 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'r'+CHAR(39)+' THEN '+CHAR(39)+'رهن'+CHAR(39)
12 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'f'+ CHAR(39)+' THEN '+ CHAR(39) +' Ù?روش '+CHAR(39)
13 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'e r'+CHAR(39)+' THEN '+CHAR(39)+ 'اجاره - رهن '+CHAR(39)
14 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'e f'+CHAR(39)+' THEN '+CHAR(39)+'اجاره - Ù?روش '+CHAR(39)
15 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'r f'+CHAR(39)+' THEN '+CHAR(39)+' رهن - Ù?روش '+CHAR(39)
16 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'e r f'+CHAR(39)+' THEN '+CHAR(39)+'اجاره - رهن - Ù?روش'+CHAR(39)
17 SELECT @SQL=@SQL+' ELSE op END AS xop, CASE LTRIM(RTRIM(type)) '
18 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'z -'+CHAR(39)+' THEN '+CHAR(39)+'زمین'+CHAR(39)
19 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'m -'+CHAR(39)+' THEN '+CHAR(39)+'مسکونی'+CHAR(39)
20 SELECT @SQL=@SQL+' WHEN '+CHAR(39)+'t -'+CHAR(39)+' THEN '+CHAR(39)+'تجاری'+CHAR(39)
21 SELECT @SQL=@SQL+' ELSE [type] END AS [xtype] FROM [data] '
22 SELECT @SQL=@SQL+' WHERE ([type] LIKE %'+CHAR(39)+@pType+CHAR(39)+'%) AND ('+@pCol+' LIKE %'+CHAR(39)+@SQ+CHAR(39)+'%)'
23 Exec (@SQL)
24 END
25 GO
 and i face this error: Line 1: Incorrect syntax near '-'.

View 3 Replies View Related

Line Chart - Line Styles

Jan 16, 2008



Hi

Anyone have any idea how to make a line style dashed or dotted in a line chart please?

If I change the series style to dashed or dotted it still appears as a solid line, yet the legend displays a dashed or dotted line....

Thanks

View 7 Replies View Related

Style: Constraints - In-line Vs Out-of-line?

Apr 18, 2008

My question is about coding style for specifying constraints when creating tables.

Two styles for defining constraints:



In-line:
CREATE TABLE Fruit
(
FruitID INT IDENTITY(1,1)
CONSTRAINT PK_fruit PRIMARY KEY CLUSTERED,
FruitName NVARCHAR(50),
FruitTypeID INT
CONSTRAINT FK_fruit_fruit_types FOREIGN KEY
REFERENCES FruitTypes (FruitTypeID) ON UPDATE CASCADE,
DateCreated DATETIME DEFAULT GETDATE()
)
Out-of-line:
CREATE TABLE Fruit
(
FruitID INT,
FruitName NVARCHAR(50),
FruitTypeID INT,
DateCreated DATETIME
)

ALTER TABLE Fruit ALTER COLUMN FruitID INT NOT NULL

ALTER TABLE Fruit ADD
CONSTRAINT PK_fruit PRIMARY KEY CLUSTERED (FruitID),
CONSTRAINT FK_fruit_fruit_types FOREIGN KEY (FruitTypeID)
REFERENCES FruitTypes (FruitTypeID),
CONSTRAINT DF_fruit_date_created DEFAULT
GETDATE() FOR DateCreated

Which style do you prefer and why?

View 2 Replies View Related

Multi-database Multi-server

Mar 27, 2007

I am new to Reporting Services and hope that what I am looking to do is within capabilities :-)



I have many identical schema databases residing on a number of data servers. These support individual clients accessing them via a web interface. What I need to be able to do is run reports across all of the databases. So the layout is:



Dataserver A

Database A1

Database A2

Database A3



Dataserver B

Database B1

Database B2



Dataserver C

Database C1

Database C2

Database C3



I would like to run a report that pulls table data from A1, A2, A3, B1, B2, C1, C2, C3



Now the actual number of servers is 7 and the number of databases is close to 1000. All servers are running SQL2005.



Is this something that Reporting Services is able to handle or do I need to look at some other solution?



Thanks,



Michael

View 5 Replies View Related

Problem Showing Data From Select Line With Another Select Line In It

Apr 7, 2007

Hi
If i use this code i cant get the data showed, it show nothing."SELECT COUNT(DogImageDate) AS Amount, DogImageDate, DogImageID FROM EnggaardImages WHERE DogImageDate NOT LIKE (SELECT TOP 1 DogImageDate FROM EnggaardImages ORDER BY DogImageDate DESC;) GROUP BY DogImageDate ORDER BY DogImageDate DESC;"
But if i use this code i get data showed"SELECT COUNT(DogImageDate) AS Amount, DogImageDate, DogImageID FROM EnggaardImages GROUP BY DogImageDate ORDER BY DogImageDate DESC;"
Then i get Images(6)Images(1)Images(1)
But i dont want the first to be showed, therefor i use the Select TOP 1, so i get a look like this
Images(1)Images(1)
But i cant get it to work.

View 2 Replies View Related







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