I dont know if this is possible or not, but I have a column that I need to remove a bunch of exponent superscript references from a html field (and leave the rest). Does anyone know how to do this with SQL?
any one know why are the following two give me different result? they should both give me no results as the value I give is not available. however, number 1 give me many results, and number 2 works as expected. I'd like the number 1 working as the same as number 2.
1. DECLARE
@SearchMCat nvarchar, @SearchTitle nvarchar, @SearchDesc nvarchar SET @SearchMCat = 'fjiewo;jafoia' SET @SearchTitle = 'fryere' SET @SearchDesc = 'fdsfdsafae33' SELECT ArticleCategory.CategoryDisplayName, Article.AudioPlaybackTargetTabID, Article.VideoPlaybackTargetTabID, Article.StartTime, Article.DateAdded, Article.Body, Article.Synopsis, Article.Title, Article.ArticleHasAudio, Article.ArticleHasVideo, Article.createdBy, Article.RatingTotal, Article.RatingCount, Article.ArticleID, ArticleCategory.CategoryName FROM ArticleCategory RIGHT OUTER JOIN Article ON ArticleCategory.ArticleCategoryID = Article.MasterCategory WHERE (ArticleCategory.CategoryName LIKE '%' + @SearchMCat + '%') or (Article.Title LIKE '%' + @SearchTitle + '%') or (Article.Body LIKE '%' + @SearchDesc + '%')
2.
SELECT ArticleCategory.CategoryDisplayName, Article.AudioPlaybackTargetTabID, Article.VideoPlaybackTargetTabID, Article.StartTime, Article.DateAdded, Article.Body, Article.Synopsis, Article.Title, Article.ArticleHasAudio, Article.ArticleHasVideo, Article.createdBy, Article.RatingTotal, Article.RatingCount, Article.ArticleID, ArticleCategory.CategoryName FROM ArticleCategory RIGHT OUTER JOIN Article ON ArticleCategory.ArticleCategoryID = Article.MasterCategory WHERE (ArticleCategory.CategoryName LIKE '%' + 'fdsafdsafdsa' + '%') or (Article.Title LIKE '%' + 'fffaery' + '%') or (Article.Body LIKE '%' + 'fdas3r43ffdsa' + '%')
I have a 20 to 30 fields on a form. Most of them are optional. However, the users can fill out what they want. If a user dosen't fill in a field when data is sent to the database it's sent as blank, instead of NULL. Is there a way I can generically say "for all textboxes if Equals("") then DBNull.Value". Without going through each and every textbox?
In the datapager, is there any way to hide the page number when the resultset is less than the pagesize. The number '1' is printed and it just looks like an orphan. I only want to show page numbers when the result set is larger than the pagesize
how can i find the value in the field which contain "," and remove it in sql e.g:
the field is: 11,12,13 how can i find 12 and remove it becomes=> 11,13 if the field is 12,13,14==> 13,14 if the field is 9,10,11,12 ==> 9,10,11 if the field is 12 only ,then result is empty
I didnt use bound field here.as it is simple grid view with auto generate columns. I want to make some columns Editable while some should not be editable
I'm trying to remove extraneous characters like quotes, commas, etc from my dataset. I get the fact in the standard way of doing things in your code behind you simply go
string data = data.replace(",",""); or something like this. However, a datasource doesn't seem to give me that capability. What can I do to make it do this? I'm importing data from an excel sheet into a gridview. The commas are goofing up my view. I'd like to replace any commas in the dataset with spaces. Here is the code I have.
removing duplicate rows from datatable or (dataset) by columnd ID (unique). Below function is working but I would like to edit/adjust the remaing (former) duplicate row's value, not the ID value btw.
Example:
ID name sport ------------------------------- 356 John Football 357 Johny Hockey 357 Johny Hockey 358 mike Soccer
should be:
ID name sport -------------------------------------------------------------- 356 John Football 357 Johny newFoo Hockey 358 mike Soccer
Public Function RemoveDuplicateRows(ByVal dTable As DataTable, ByVal colName As String) As DataTable
Dim hTable As New Hashtable() Dim duplicateList As New ArrayList() For Each drow__1 As DataRow In dTable.Rows If hTable.Contains(drow__1(colName)) Then duplicateList.Add(drow__1) Else hTable.Add(drow__1(colName), String.Empty) End If Next For Each dRow__2 As DataRow In duplicateList dTable.Rows.Remove(dRow__2) Next Return dTable End Function
I have a Document name column with varbinary(max) type column in my table
first time when i upload document i am storing doc as a byte array
Dim fs As Stream = Me.fileupload1.PostedFile.InputStream Dim br As New BinaryReader(fs) Dim bytes As Byte() = br.ReadBytes(fs.Length)
in my application i have remove atttachmentDoc button, i want to remove uploaded doc from db
so when i pass like this to my storedprocedue
Dim obj As New cls1 Dim bData() As Byte = New Byte(0) {} bData=nothing With obj Dim dt As DataTable = Read_Doc() If dt.Rows.Count > 0 Then If Not IsDBNull(dt.Rows(0)("Document")) Then .Document = bData .Document_extension = "" .Remove_Attachment(Me.Selected_ID) End If End If End With
i got error
dbAccess.executeQuery: Procedure or function 'SP_DML1' expects parameter '@Document', which was not supplied.
select a.Del_Date,a.Deliverables, b.Cost_Code, c.UserName, c.Email from mtblDeliverables a join mtblContract_New b on a.Cost_Code = b.Cost_Code Join mtblUser c on b.Proj_Lead = c.UserName where a.Del_Date = DateAdd(dAY, 10, GetDate ());
This will show me all records which has a Del_Date = GetDate()+10 days.My data in the SQL is stored in datetime format.When i execute this, no records are shown. Is this because of the time part in the GetDate(). how to remove the timepart in the GetDate ().
I am using ssrs 2005 .My text field contains the following data As follow : Database is as:i am getting value as :Total Population (in 1000s)but in ssrs it is displaying as like this : (Total Population (in 1000sBut i want as like in Database.Please let me know what is to be done at the earliest
I use an objectdatasource programmatically to use a parameterless method when SearchWord variable is empty and a Search method with one parameter when SearchWord is not empty, the event I use is objectdatasource selecting so that I can adjust parameters conveniently, I have a problem here: I can add a new parameter and set its value but I can't remove a previously added parameter from objectdatasource selectparameters and an error raises because of this, this is the selecting method:
[Code]....
Both adding and removing the search parameter takes place in this method while adding works removing the added one Not works.
{"Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition."}
view on browser application
Line 33: Line 34: GridView1.DataSource = dtLine 35: GridView1.DataBind()Line 36: End SubLine 37:
This is an my vb code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Me.IsPostBack Then Me.BindGrid() End If End Sub Private Sub BindGrid()
how do you retrieve a particular record in a table plus x number of records that comes after it, assuming it is ordered in a particular way?I want to retrieve 3 records, and I want record where Row_A = 2 to be the first record, and the next 2 more records that follows it, assuming it is ordered by Row_A.
I had a repeater that will be binded using dataset
[Code]....
and on page load I write this code
[Code]....
it worked very well on my machine , after applying it on the server it give the following error
Server Error in '/' Application.
Number must be either non-negative or -1. Parameter name: millisecondsTimeout Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Number must be either non-negative or -1. Parameter name: millisecondsTimeoutSource Error: