|
anbusenthil wrote: is tis query correct after joins ...
This is not database forum.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
anbusenthil wrote: select @themeid=t.themeid,@themename=t.th_name from emptheme e left outer join themesetting t on
e.themeid=t.themeid and e.empguid=@sessionvalue
is tis query correct after joins ...
is it possible to use and join condition
is tis query correct after joins ...
is it possible to use and join condition
First of all this is ASP.Net Forum and This is your repost. While asking problem regarding the same post then continue with that thread itself rather than post a new question.
I believe you are using SQL Server to run your query. So what is the output for that statement ?
|
|
|
|
|
anbusenthil wrote: is tis query correct after joins ...
It depends on what you want it to show and what your data model is... How're we supposed to know. If you want to know if it's syntactically correct, why don't you run it...
|
|
|
|
|
hi ! all !!
i m doing a search application in asp.net 2.0 , when i enter a sentence in text box the related data show to me , but i want the keyword that i have enter in text box that show me in bold later,
plz help me ...........
|
|
|
|
|
Replaced the searched text as <b> Your Text</b> . Means, if you want to find "Your Text" and its available then just replace text with <b> Your Text </b>
|
|
|
|
|
Without seeing the code, it's hard to specify how can you do it. But assuming that you are putting individual search result in a string variable and your search keyword is "Giant" (for example):
string searchResult = "Andy the Giant Killer";
searchResult = searchResult.Replace("Giant", "Giant");
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
m devloping a search engine like google in asp.net . i have a textbox when i enter a sentece in text box . it is diffrenciated in many keys . i want this key in bold letter.
my code is.
Imports System.Data
Imports Oracle.DataAccess.Client
Partial Class Search_files
Inherits System.Web.UI.Page
Dim con As New OracleConnection(ConfigurationManager.ConnectionStrings("constr1").ConnectionString)
Dim cmd As New OracleCommand
Dim da As New OracleDataAdapter
Dim ds As New DataSet
Dim dr As OracleDataReader
Dim fileNamePart(20) As String
Dim filterfilename As New ArrayList()
Dim filenameLen, i, j, index, indexarr, count As Integer
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If txtfiledesc.Text <> "" Then
filenameLen = txtfiledesc.Text.Length
indexarr = 0
j = 0
count = 0
For i = 0 To filenameLen - 1
count = count + 1
If Asc(txtfiledesc.Text.Chars(i)) = 32 Then
For index = indexarr To indexarr
fileNamePart(indexarr) = txtfiledesc.Text.Substring(j, count - 1)
Next
indexarr = indexarr + 1
j = i + 1
count = 0
End If
Next
fileNamePart(indexarr) = txtfiledesc.Text.Substring(j, count)
' Dim jim As Integer = fileNamePart.Length
Label1.Text = ""
Dim filterarr, filterarr1 As Integer
For filterarr = 0 To indexarr
If fileNamePart(filterarr).ToString.ToLower = "the" Or fileNamePart(filterarr).ToString.ToLower = "be" Or fileNamePart(filterarr).ToString.ToLower = "is" Or fileNamePart(filterarr).ToString.ToLower = "an" Or fileNamePart(filterarr).ToString.ToLower = "a" Or fileNamePart(filterarr).ToString.ToLower = "are" Or fileNamePart(filterarr).ToString.ToLower = "of" Or fileNamePart(filterarr).ToString.ToLower = "for" Or fileNamePart(filterarr).ToString.ToLower = "in" Or fileNamePart(filterarr).ToString.ToLower = "on" Or fileNamePart(filterarr).ToString.ToLower = "at" Or fileNamePart(filterarr).ToString.ToLower = "to" Or fileNamePart(filterarr).ToString.ToLower = "shall" Or fileNamePart(filterarr).ToString.ToLower = "will" Then
' fileNamePart(filterarr) = fileNamePart(filterarr + 1)
For filterarr1 = filterarr To indexarr - 1
fileNamePart(filterarr1) = fileNamePart(filterarr1 + 1)
Next
fileNamePart(filterarr1 + 1) = Nothing
' ReDim Preserve fileNamePart(fileNamePart.Length - 1)
filterarr = filterarr - 1
End If
Next
Dim ind1 As Integer
For ind1 = 0 To 10
If (fileNamePart(ind1) <> fileNamePart(ind1 + 1)) And (fileNamePart(ind1) <> Nothing) Then
filterfilename.Add(fileNamePart(ind1))
End If
Next
'fileNamePart = DirectCast(Resize(fileNamePart, 5), String())
Dim z As Integer = 0
While z < filterfilename.Count
Label1.Text = Label1.Text & " || " & filterfilename.Item(z) ' fileNamePart(0)
z = z + 1
End While
popdata()
Else
Dim scrpt As String = "<script language='javascript'>window.alert('Plz Insert A Data To Search');</script>"
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "showsuccess", scrpt, False)
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Public Sub popdata()
If con.State <> ConnectionState.Open Then
con.Open()
End If
cmd.Connection = con
If filterfilename.Count = 1 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%'"
ElseIf filterfilename.Count = 2 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%'"
ElseIf filterfilename.Count = 3 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%'"
ElseIf filterfilename.Count = 4 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(3).ToString() & "%'"
ElseIf filterfilename.Count = 5 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(3).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(4).ToString() & "%'"
ElseIf filterfilename.Count = 6 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(3).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(4).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(5).ToString() & "%'"
ElseIf filterfilename.Count = 7 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(3).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(4).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(5).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(6).ToString() & "%'"
ElseIf filterfilename.Count = 8 Then
cmd.CommandText = "select KM_SRL,KM_SRL_DESC,KM_ATTACHMENT_REF,KM_AUTHOR,KMLVL,LVLDESC from hrm.KM_REPOSITORY_VIEW where STATUS='LIV' and KM_SRL_DESC LIKE '%" & filterfilename.Item(0).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(1).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(2).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(3).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(4).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(5).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(6).ToString() & "%' or KM_SRL_DESC LIKE '%" & filterfilename.Item(7).ToString() & "%'"
Else
Dim scrpt As String = "<script language='javascript'>window.alert('Plz give more appropriate sentencse or word');</script>"
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "showsuccess", scrpt, False)
Exit Sub
End If
da.SelectCommand = cmd
da.Fill(ds, "tab1")
GridView1.DataSource = ds.Tables("tab1")
GridView1.DataBind()
If con.State <> ConnectionState.Closed Then
con.Close()
End If
End Sub
End Class
|
|
|
|
|
i m devloping a search engine like google in asp.net . i have a textbox when i enter a sentece in text box . it is diffrenciated in many keys . i want this key in bold letter.
|
|
|
|
|
I have a task that i have to synchronize/update both my web(asp.net & SQL 2005) and windows application databases(VB.net & SQL 2005).
My scenario is my web app. and windows app. both accept reservations. I want any reservation happen to my web or windows app will reflect to both databases(online & local) at the same time.
Please help me.
WTF
Thanks.
al hajjaj
|
|
|
|
|
brine_fury wrote: I want any reservation happen to my web or windows app will reflect to both databases(online & local) at the same time.
That's not possible. How the server database can communicate with your local one? Why don't your windows application connect to online database, pull all missing records and update the local database?
brine_fury wrote: WTF
Do you mean this[^]
|
|
|
|
|
You dont actually need two databases.
Write a web service(data access layer) which talks to a single database.
Use this web wervice in both web and windows to perform the actions.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Yup. I am agree with your view.
|
|
|
|
|
ya If we split the logical layers then we can do that easily. Web service is an ultimate solution.
|
|
|
|
|
Web service is an ultimate solution but if you think this way is not possible you can move just the reservations table on web service and you can synchronize other tables at a specific time. On this way you have enough time to convert all your database to web service. Good luck!
|
|
|
|
|
|
Make the expand image runat=server . You can use FindControl() method to find this image and toggle it's visibility depending on your condition.
|
|
|
|
|
|
How is this an ASP.NET question ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Check if they provide the RSS for the information then read content from RSS or you can read the content from page directly.
|
|
|
|
|
Check this article out:
http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm[^]
I created a test ASP.net web page with a button on it and used the following code to retrieve to the web page you wanted. what you would have to do is parse through the string, "lcHtml", which contains the table data.
Good luck.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myURL As String = "http://www.moneycontrol.com/stocks/marketstats/mostactive.php?optex=NSE&index=31&opttopic=mostactive"
' *** Establish the request
Dim loHttp As HttpWebRequest
loHttp = WebRequest.Create(myURL)
' *** Set properties
loHttp.Timeout = 10000 ' 10 secs
loHttp.UserAgent = "Code Sample Web Client"
' *** Retrieve request info headers
Dim loWebResponse As HttpWebResponse
loWebResponse = loHttp.GetResponse()
Dim enc As Encoding
enc = Encoding.GetEncoding(1252) ' Windows default Code Page
Dim loResponseStream As New StreamReader(loWebResponse.GetResponseStream(), enc)
Dim lcHtml As String
lcHtml = loResponseStream.ReadToEnd()
loWebResponse.Close()
loResponseStream.Close()
Response.Write(lcHtml)
'System.Diagnostics.Debug.WriteLine(lcHtml)
End Sub
|
|
|
|
|
very good..bosss........
i am having 6 months of experience in asp.net what i want is to display only the matter in the table where share and their respective prices have been declared....can you please assist with this...
thanks again...
|
|
|
|
|
|
David,
What I want is the code to retrieve that specific table in either excel format or in txt format on to my local computer. Can you assist with that code please??????
|
|
|
|
|
At this time, I have no time to work on such a project. I'm busy at work and home. I find this project interesting, so I may work on it for my own knowledge, but I can't guarantee any timeframe for completion.
|
|
|
|
|
Thanks you...
i will eagerly wait for your post....
|
|
|
|