How To Replace Empty Lines When Using SQLDataSource

Mar 1, 2006

I have an app which uses SQLDataSource to update the information to database (SQL Server 2000). Is there a way to trim the input of users somehow (blank lines) ? For example if I have an Comments-textarea on my form and users enter text to it, can I somehow take out the extra blank lines out of that textarea before submitting the data to database ? I know how to do this programmatically, but was just wondering if this could be done when using SQLDataSource-control.

I'm using DataReader to extract the information from database to an CSV-file. Because of the blank lines, occasionally CSV are really messed up because of that. Is there a way to remove the blanklines when iterating the DataReader values ?

 

View 1 Replies


ADVERTISEMENT

MultiLine TextBox Empty Lines Into SQL

Apr 20, 2005

I have a multiline textbox where users enter comments, then the comments are put into a SQL table, then a datagrid retrieves the comments from the table and displays them.  The problem is when a user has blank lines between paragraphs, the datagrid simply puts the paragraphs together.  I know I can use the <br> command to display the text properly in the grid, but how do I get the <br> command to store in the SQL table where the paragraph breaks would be.  The paragraph breaks go into the SQL table as nothing more than several spaces.  How do I get this to work?
 
Thanks,
ACFalcon

View 3 Replies View Related

Can Synonyms Be Used To Replace Hundreds Of Lines?

Sep 10, 2006

Hello

I'm looking for a way to store a large chunck of text (200 lines) in a variable which can be called in different objects within the database.

For example: I have several stored procedures that create the same temp table which exists of 200 column names over and over again.

It would have to look like this

Import myScript (I keep thinking of Import like used in .NET)

and myScript could exist of:

CREATE #MyTable(
...)

or even some simple text or a part of a sql statement.

I'm familiar with synonyms but you can't use that in this scenario.
Then I thought of functions. The scalar function returns a result, not what I want here. Table valued function return tables, not what I want.

Many thanks in advance!

View 3 Replies View Related

Within A SELECT, How Do I Replace An Empty Or Null Value With A Value From Another Table?

Apr 20, 2008

Hello,I'm a beginner in SQL and I have been searching through the SQL Cookbook and Google but I can't seem to find an example of what I want to do. I want to create a report that will return names and emails using two of my tables. I want to use the email in my primary table in the select but if it is null or empty I want to replace it with an email from my secondary table. Below is what I would like to do but I got a syntax error with it in SQL Server 2000. SELECT MemberID As ID, MemberFirstName As FirstName, MemberLastName As LastName, (IF MemberEmail = '' THEN SELECT TOP 1 OtherEmail FROM OtherTable WHERE OtherID = MemberID) As EmailFROM PrimaryTableThanks for your time.Jason  

View 8 Replies View Related

Derived Column Logic To Replace Empty String With Null?

Nov 7, 2006

Ok.. so I have a fixed position data feed. I read the file in as just whole rows initially, process a specific position and evaluate a conditional split to determine direction of the file for proper processing (file contains multiple recors with different layouts). This all works fine. I then use the derived column feature to process all the columns.

Most of the columns are as simple as SUBSTRING(RecordData,1,10) for example to get the first column. This all works for string data. I then have a column that is a date field. The problem occurs that the code SUBSTRING(RecordData,20,10) returns either a date or empty set of data if no date was in the original file. When this gets sent to the OLEDB connection (SQL Server 2005) into the date field it fails. If the record has a date it works, but if it is empty it fails the insert.

I tried to replace empty strings with NULLs with this code. REPLACE(TRIM(SUBSTRING(RecordData,20,10)),"",NULL(DT_WSTR,10)). This does not work. So my question is how do I bring a date field from a fixed flat file into a SQL datetime field using a derived column? More specifically is how do I set it to NULL if its empty data? When I use the above code it inserts all the rows from the file, but it sets all rows to NULL not just the empty ones.

Thanks.

View 6 Replies View Related

If SqlDataSource.Select = Empty Then...?

May 28, 2007

(Newbie). I'm trying to: 1) check if the SELECT command has returned any records, and 2) put a msg box on the screen if there are no records returned from the SELECT query.  The type of code I'm heading towards is:  (but it's wrong). Thank you in advance for your C# code suggestion.
 protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{if (SqlDataSource1.SelectParameters.Contains is "") then
MessageBox.show ("There are no records available") ;
}

View 8 Replies View Related

Check If SqlDataSource Is Empty In CodeBehind

Feb 10, 2006

This is probably an easy one.
What is best way to determine if a SqlDataSource is empty (i.e. the query produced no results) in the CodeBehind?
I'm using this:
if (SqlDataSource1.SelectCommand.Contains(String.Empty))
{
      //Add code for scenario here.
}
It seems to work, but something just doesn't feel right about it for some reason.
Thanks

View 2 Replies View Related

What Does A Stored Procedure Recieve From A SqlDataSource Who's Parameter Is Empty And No Default Value Set?

Nov 24, 2006

If a sqldatasource is programed to send textbox1.text to a stored procedure, and the .text property is left empty, and there is no default value set for the parameter, what exactly is the stored procedure receiving?I would like to run a IF BEGIN statement on the value of the parameter in the stored procedure but the following does not work:IF @Parameter IS NULL BEGINor IF @Parameter = '' BEGINThe only way I've gotten it to work is if I set the default value of the parameter being sent to a specific alphanumeric value. Then do something like:IF @Parameter = '99' BEGIN<Code Here>END 

View 4 Replies View Related

To Catch The Event When There Is Empty Dataset As A Result Of A Query In Sqldatasource

Aug 1, 2007

hi,
i want to execute a finctionX() based on the returned resultset of SQLDataSource. For example, if the SELECT command returns nothing based on a specific search criteria then I want to execute functionX(). Currently, I have a string that displays "No Result" in the GridView in such case.
How to catch the  resultset of SQLDataSource?
-nero

View 1 Replies View Related

How To Replace Empty Space Or White Space In A String In A Stored Procedure

Nov 14, 2007

Hi,
 I am trying to do this:
UPDATE Users SET  uniqueurl = replaceAllEmptySpacesInUniqueURL('uniqueurl')
What would be the syntax.
Any help appreciated.
Thanks
 

View 1 Replies View Related

SELECT A Single Row With One SqlDataSource, Then INSERT One Of The Fields Into Another SqlDataSource

Jul 23, 2007

What is the C# code I use to do this?
I'm guessing it should be fairly simple, as there is only one row selected. I just need to pull out a specific field from that row and then insert that value into a different SqlDataSource.

View 7 Replies View Related

SUM OF THE LINES

May 24, 2006

Hey,
take a look at the below. I need to sum the real balance of a line with the credit with the line above, or, n + 1. I don't wanna to have to walk across the lines to do the sum. Any idea of how to do that in a easier and better way? I tried using T-SQL, but I couldn't figure out how to do a reference to the next line on the SQL without moving the cursor.



Date
Reference
Description
Debit
Credit
Real Balance
Bank Balance
 
Grp
Action




$0.00
$6,000.00
$86,814.27

*
 
  




$0.00
$4,000.00
$90,814.27



  




$0.00
$666.00
$91,480.27

*

Thank you!

View 2 Replies View Related

Individual SqlDataSource() Or Common SqlDataSource() ?

Mar 8, 2007

i am using visual web developer 2005 with SQL Express 2005 with VB as the code behindi have one database and three tables in itfor manipulating each table i am using separate SqlDataSource() is it sufficient to use one SqlDataSource() for manipulating all the three tables ? i am manipulating all the tables in the same page only please help me

View 1 Replies View Related

SQL Mail And New Lines

Mar 7, 2008

I'm using SQL mail to send an email from a stored procedure which works fine. However I need a line break in the middle of this email which I am struggling to achieve. I've tried adding char(13)+char(10) to the middle of the email body string but this does not seem to do anything.
 Any ideas?

View 2 Replies View Related

Lines Per Page

Jan 14, 2008

I am using SQL Server 2005 Reporting Services and all my reports preview with many more pages, as the preview will show Page 1 of 20, but if I print the report I get say 12 pages. The reports are always correct, but the preview show less data per page? Is there a way to get the preview to be what is going to print out?

This occurs in MS Visual Studio 2005 also as well as from the web. On a drill down report I get on some reports only 10 line when the print out will have 30 lines perpage

View 12 Replies View Related

Break SQL Statement Into More Lines?

Jul 16, 2007

 I have long SQL statement  String sqlQuery = "INSERT INTO Objekt VALUES(@RegijaID, @StatusID, @VrstaID, @PozicijaID, @Adresa, @Otok, @Ime, @Prezime, @JMBG, @Telefon, @Telefon2, @Mobitel, @Mobitel2, @email, @Cijena, @Cijenam2, @BrojNaloga, @Agent, @BrojSoba, @BrojKatova, @BrojKupaonica, @NaKatuBr, @PovrsinaStambena, @PovrsinaZemljista, @UdaljOdMora, @PrviRed, @PogledNaMore, @Bazen, @Garaza, @Prilozi1, @Prilozi2, @Prilozi3, @Napomena, @smallImage, @KratkiOpisEN, @DugiOpisEN, @KratkiOpisHR, @DugiOpisHR, @PonudaTjednaCroestate, @PonudaTjednaNaslovCroestate, @PonudaTjednaBroker, @PonudaTjednaNaslovBroker, @PonudaTjednaKorcula, @PonudaTjednaNaslovKorcula, @PonudaTjednaCroProperty, @PonudaTjednaNaslovCroProperty, @PonudaTjednaDalmVillas, @PonudaTjednaNaslovDalmVillas, @LinkZaViseoMjestu, @DisplayOnWWW, @TS)";  How broken it into more lines? 

View 6 Replies View Related

Executing Multiple Lines Of Sql Via C#

Jan 27, 2008

I am generating hundreds of lines of sql with a tool and wish to execute is in runtime. The sql consists of table creation, procedure creation, aswell as inserts and updates. When i try with SqlDataAdapter I get an error. Does anyone have a solution on what I can do?         

View 2 Replies View Related

Pulling Single Lines From A DB

Apr 26, 2004

hi im making a page where i want a single line at a time to be pulled from my MS Database, basically at the moment i have a list of questions, but the page is displaying all the questions from my database, i only want it to pull out 1 and then if the user clicks the true button then it goes to another page and displays another question?

Any ideas

Regards,

Joe

View 1 Replies View Related

HTMLto SQL To HTML..... New Lines?

Jun 16, 2005

I take some data from a textbox and then dump it in to SQL.. and then try to show it on the page but the new lines in code dont show in HTML.I grab the data via a <%#Eval(xxx>%>so doing a replace isnt really an option there...any other ideas?

View 1 Replies View Related

Exporting Data/1st Three Lines NOT CSV..

Oct 3, 2005

I have a specific format that I need to export data to. The first three lines of the document MUST be in the form of:

ascii
,
klg, Eastern Daylight Time,1,1
PineGrove,0,2005/10/01,00:00,1,1.75,192
PineGrove,0,2005/10/01,00:05,1,1.75,192
Pinegrove,0,2005/10/01,00:10,1,1.75,192

If I set this up in DTS and do an export, it puts commas after ascii - which I cannot have.

I've also tried using two data sources and exporting twice (hoping to append), however, one just overwrites the other.

Anyone have any ideas?? :o

Thanks in advance,
Krista

View 6 Replies View Related

Geometry - Parallel Lines

Mar 19, 2014

Assuming I have a line, is there a function I can call to create a parallel line at a given distance away.i.e - with the below I would want to draw a parallel line to the one output.

DECLARE @line geometry = 'LINESTRING(1 1, 2 2, 3 3, 4 4)'
SELECT @line

View 9 Replies View Related

Double Lines In The Tables

Nov 29, 2007

Hi all we are student of university
and we trying to make application

We are programming in Tsql.we must make a list of backup sets and backup jobs.

Every backupjob can have more then one backupsets. The problem is when we want to put this in table then. We see the costumors name double in it .

For excample

Mr Jurgen has more backupjobs

We see then in our table then

Loginname Wich Status
MRJURGen SET 1 GOOD
Mrjurgen Set 2 Good
Mrjurgen Set 3 NOT ok


What we want that comes like this in a table

Loginname Wich Status
MrJurgen Set 1 Good
Set 2 Good
Set 3 Not ok

But we keep getting MRjurgen in also in the other lines !

The solution that we think that could help is an while loop

But sadly it doesnt work

So we desperate asking here how to do this :(

Thanks

Students

View 5 Replies View Related

Taking An Average From A Few Lines

Mar 4, 2008

I am trying to get an average result from similar records in a view:

Order No: Product: Price:
1 1 5
1 2 3
1 3 7

2 1 5
2 2 3
2 3 7
2 4 2

I need the sql statment to get the average price of order 1 and order 2 seperatly. Giving a result like:

Order No: Av Price:
1 x
2 y


Thanks in advance for you help

View 4 Replies View Related

Long SQL Lines For Osql

Feb 23, 2006

We have a very long and complicated SQL script which we run to upgradea version of our software from old to new. It works great in QueryAnalyzer, but when run through osql it takes errors on lines that arevery long and (I think) stops reading after a certain amount ofcharacters. I've searched the net but haven't found anyone mentioningthis before. I have tried the -w 5000 parm to no avail.Any suggestions?

View 4 Replies View Related

Adding New Lines Into Results In The

May 15, 2006

I used to be able to enter new lines into the result pane cell for text(and varchar) data in Enterprise Manager, but now that I am using SQL2005 Management Studio, this feature is gone.Is there any way to do this?Also, copying to/from excel chops off part of the text in a cell and isvery infuriating.Any help would be appreciated.Dan

View 2 Replies View Related

Chart Dotted Lines

Nov 28, 2007

Hi,
The chart is set to simple line
I can not get my SSRS chart to show just the dots, instead it is joining the points together and show the points joining together and therefor appear as lines..
even tried setting the chart to simple scatter but then nothing appears on graph.
Any thoughts please?

View 1 Replies View Related

Drawing Two Lines On The Same Graph

Jan 7, 2008

i wanna create two line types on the same graph. I'm using the following queries.






Code Block
select count(l.created) as LoanOriginationNumberPreApproved , convert(char( 11), l.Created) as PreApprovedDate
from LoanApplication l
where l.Status <> 'Cancelled'
Group by l.Created






and





Code Block
select count(l.SubmittedOn) as LoanOriginationNumber , convert(char( 11), l.SubmittedOn) as SubmittedDate
from LoanApplication l
where l.Status <> 'Cancelled'
Group by l.SubmittedOn




I combined these queries. I add clumns of the second query to select statement of first code. also added group by l.submittedon to group by l,created as group by l.created, l.submiited on. This is the problem.(I mean grouping)

But then SSRS does not allow me to put preaaproveddate and submitteddate to drop category filed?
Does anyone know how to do that?

View 2 Replies View Related

Extremely Long Lines

Sep 22, 2006

Hi,

When i open a project in ssis show the message:

"Document contains one or more extremely long lines of text. These lines will cause the editor to respond slowly when you open the file. Do you still want to open the file."

I click Yes and my project open normally. Someone know why this happen? My project is small, have one package with any imports excel files to Sql Server 2005.

Thanks

André Rentes

View 1 Replies View Related

Trend Lines In RS2005

Jan 24, 2007

Are trend lines supported in RS2005, and if so how do you produce them?

Thanks,

Peter Cwik

Trizetto

View 11 Replies View Related

Fold The Detailed Lines

Apr 23, 2008

Hello,

I would like to know how to set the grouping lines or the detailed line to get the function like in Excel: group plan
Example:

+ Group line GL1
Detailed Line 1
Detailed Line 2

When the grouping function is active, you see the Group line GL1 only. By clicking on the + icone, you will see all the detailed lines (like in Excel document).

Thank you in advance for your replies.
regards,


View 4 Replies View Related

Jump Or Detect Corrupt Lines In DTS

Mar 7, 2001

Hi,

I import from CSV files into MSSQL tables.
My hierarchy absolutely wants to keep the CSV standard format.
Some string have quotes inside.
With Sybase it jumps these corrupted lines.
With MSSQL and DTS, it breaks all the importation.

Does anyone know how to jump (aloso is there a possibility to detect the number of corrupted lines, Sybase can do that) ?

Thanks for your answers

Best Regards

Axel

View 1 Replies View Related

Suppression Of Dashed Lines In Output

Jun 23, 2003

Hi All, I'm saving the output of a query into an html file. The dashed lines above rows that have a select in it are showing up in the final doc and are playing havoc with my page. Does anyone know of a command to stop them from appearing. nocount just suppresses the rows affected message. ANY help is appreciated.

Thanks!

View 1 Replies View Related

Contiguous Data - Address Lines

Jun 1, 2007

Hi all,

I'm trying to join an Address table's columns:

ID, AddressLine1, AddressLine2, AddressLine3, ..., AddressLine7

into a contiguous layout. The issue is some fields are empty.

so I might have:

id ad1 ad2 ad3 ad4 ...
1 aa __ vv __
2 __ xx __ __
3 tt rr __ ee

I need to turn it into:

id ad1 ad2 ad3 ad4 ...
1 aa vv __ __
2 xx __ __ __
3 tt rr ee __

I've done this up with a cursor, a user defined function, but I need to do it up 2 other way. My mind is blank - any ideas would be great

colabus

View 4 Replies View Related







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