|
I want to Fetch a particular location from google map of 5 km distance using zip code basis
I am using Google Web service.It is showing the error of Invalid key .
The code as follows:
Dim ProxyHost As String = "192.168.0.100"
Dim ProxyPort As Integer = 8080
Dim ProxyUser As String = ""
Dim ProxyPassword As String = ""
Dim ProxyDomain As String = "http://api.google.com/search/beta2"
Dim oWebProxy As System.Net.WebProxy = New System.Net.WebProxy(ProxyHost, ProxyPort)
oWebProxy.Credentials = New System.Net.NetworkCredential(ProxyUser, ProxyPassword, ProxyDomain)
' obj_wrr.Proxy = oWebProxy
'obj_wrr.Credentials = New System.Net.NetworkCredential(feedid, password)
Dim s As localhost.GoogleSearchService = New localhost.GoogleSearchService
s.Proxy = oWebProxy
Dim r As localhost.GoogleSearchResult
r = s.doGoogleSearch("", TextBox1.Text, 0, 10, False, "", False, "", "", "")
Dim strFile As String = "C:\\result.html"
Dim sw As StreamWriter = File.CreateText(strFile)
sw.WriteLine("" & Microsoft.VisualBasic.Chr(9) & "BODY { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 9pt; color : #000000; SCROLLBAR-FACE-COLOR: white; SCROLLBAR-HIGHLIGHT-COLOR: #003366; SCROLLBAR-SHADOW-COLOR: #003366; SCROLLBAR-3DLIGHT-COLOR: #f9f9f9; SCROLLBAR-ARROW-COLOR: #003366; SCROLLBAR-TRACK-COLOR: white; SCROLLBAR-DARKSHADOW-COLOR: #f9f9f9 }")
For Each dc As localhost.DirectoryCategory In r.directoryCategories
sw.Write("Category : ")
sw.WriteLine(dc.fullViewableName)
sw.WriteLine("
")
Next
For Each re As localhost.ResultElement In r.resultElements
Dim strTitle As String = "" + re.title + "
"
sw.WriteLine(strTitle)
Dim strSnippet As String = re.snippet + "
"
sw.WriteLine(strSnippet)
Dim strLink As String = "" + re.URL + " - " + re.cachedSize + "
"
sw.WriteLine(strLink)
sw.WriteLine("
")
Next
sw.Close()
Label1.Text = TextBox1.Text + " 's web search"
Dim estResults As Integer = r.estimatedTotalResultsCount
Dim ldTime As Double = r.searchTime
Label1.Text = "Total " + Convert.ToString(estResults) + " " + "1 - 10 seach result Total time:" + Convert.ToString(ldTime)
Dim obj As Object = Nothing
Dim di As DirectoryInfo = New DirectoryInfo(Environment.CurrentDirectory)
Dim strFilePath As String = di.FullName + "\" + strFile
WebBrowser.Navigate(strFilePath, obj, obj, obj, obj)
|
|
|
|
|
How can we implement CallOuts to a text document in web application
|
|
|
|
|
what is the diffrence between string and string builder
|
|
|
|
|
Hi
I think you must read MSDN - StringBuilder Class
This class represents a string-like object whose value is a mutable sequence of characters. The value is said to be mutable because it can be modified once it has been created by appending, removing, replacing, or inserting characters. For comparison, see the String class.
Most of the methods that modify an instance of this class return a reference to that same instance. Since a reference to the instance is returned, you can call a method or property on the reference. This can be convenient if you want to write a single statement that chains successive operations one after another.
The capacity of a StringBuilder is the maximum number of characters the instance can store at any given time, and is greater than or equal to the length of the string representation of the value of the instance. The capacity can be increased or decreased with the Capacity property or EnsureCapacity method, but it cannot be less than the value of the Length property.
Implementation-specific default values are used if no capacity or maximum capacity is specified when an instance of StringBuilder is initialized.
Notes to Implementers: The default capacity for this implementation is 16, and the default maximum capacity is Int32.MaxValue.
A StringBuilder can allocate more memory as needed to store characters when the value of an instance is enlarged, and the capacity is adjusted accordingly. The amount of memory allocated is implementation-specific, and ArgumentOutOfRangeException is thrown if the amount of memory required is greater than the maximum capacity.
For example, the Append, AppendFormat, EnsureCapacity, Insert, and Replace methods can enlarge the value of an instance.
The individual characters in the value of a StringBuilder can be accessed with the Chars property. Index positions start from zero.
|
|
|
|
|
The short answer is that you use String Builder when you are doing operations on a string, such as concatenation. It's optimized for those operations more than strings.
|
|
|
|
|
Hi All
I have one problem in asp.net.I am adding everytime new column in datagrid in asp.net.I got Column index as &HE.But i want 14 instead of &HE.How to convert E to 14.What i do?Pls help me.
Thanx
monika
|
|
|
|
|
Use the function ‘Cint’. CInt("&HE") will return the value 14.
Thomas
|
|
|
|
|
I am designing a web page where I am showing data in a datagrid selecting table names from a dropdownlist.The datagrid is editable.
I am not finding any way to update the data in database.
Kaustav Guha
|
|
|
|
|
i have a calculated data, for example, 14.429424242344, but i only need the rounded two digit only, how to do it using asp.net ?
for example, calculate data : 14.429424242344
data i need to store : 14.43
how to do it ?
Best regards,
Chee ken
|
|
|
|
|
Hi there
FormatNumber(YourNumber,[number Of digits after decimal],[include leading digit as Tristate],[use parens for negative numbers as Tristate],[group digits as Tristate])
This is the function and as for the parameters
1)ur number
2)2 //because u want to display 2 digits after decimal
u can define the rest as u need or keep them "default"
Best Regards
3ala2
|
|
|
|
|
MATH.ROUND (3.1786436,2) = 3.17
MATH.CEILING (3.1786436,2) = 3.18
|
|
|
|
|
Thanks for your help, The function can run already !!
Best regards,
Chee ken
|
|
|
|
|
Hi
i am trying to add data in tree view control from database, I have folders and documents & sub folders in those folders. so i want to show hierarchy of folders in treeview.
my code is as under Here I have table called folder and in this table unique key is ID and parent key is ParentFolderID which reference to Id of the same table so if there are sub folders then ParentFolderId will be parent Folder's ID. So if there is table which is root level then its ParentFolderID will be reference to itself.
Try
RootFolderStr = "Select Name from Folder where ID=ParentFolderID"
dr = temp.ExecuteDataReader(RootFolderStr)
While dr.Read
Root = dr("Name")
tNode.Text = Root
Tree1.Nodes.Add(tNode)
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
dr.Close()
End Try
when i am adding one item it works fine but if there are more items then it returns error
"Index must be within the bounds of the List.Parameter name: index"
So please help if any one knows the answer.
Thanks in advance
|
|
|
|
|
Include Microsoft.Web.UI.WebControls.dll in your project.
For runtime addition of nodes for TreeView control do following steps
//On aspx page register TreeView as
<%@ Page language="c#" Codebehind="TreeControl.aspx.cs" AutoEventWireup="false" Inherits="UserControlApplication.TreeControl" %>
//Treeview Control
//Add the root node for User Control Tree1 in .cs file
TreeNode tNode = new TreeNode();
tNode.Text="Root";
tree1.Nodes.Add(tNode);
//Add Child Node to root node tNode
TreeNode tChileNode1 = new TreeNode();
tChileNode1.Text = str;//This string is the information retrieved form database
tNode.Nodes.Add(tChileNode1);
#Abhi#
|
|
|
|
|
hi abhi
i have try this but it will work when i have only one row.
if there are more rows that i m fetching then error is coming that i have asked in my previous question
so if there is another way to solve it please let me know
Thanks
|
|
|
|
|
Hi
Try this -
Define your chile node inside while loop and fill it and after it add to root node.
:->:->:->
#Abhi#
|
|
|
|
|
Learn how to develop your next ASP.NET2.0 application using Provider Model.
If you are interested, you can download a copy (PDF) from below URL:
http://www.agdstudio.com[^]
|
|
|
|
|
I need to add a "ENTER" whitespace into string, so when i display the string into control, the string will be continue display on next row.
How to add this "ENTER" ?
for example;
dim str as string = "A ENTER B"
so the output will be :
A
B
Best regards,
Chee ken
|
|
|
|
|
Use Environmend.NewLine:
Dim str As String = "A" + Environment.NewLine + "B"
Then of course it depends on if the control handles line breaks in the text or not.
---
b { font-weight: normal; }
|
|
|
|
|
Dim str As String = "A" + <-br-> + "B"
plz remove "-" side of the "-br-"
hi
hope can work.
-- modified at 8:10 Monday 30th October, 2006
|
|
|
|
|
|
The function can run already , thanks for your help !!
Best regards,
Chee ken
|
|
|
|
|
Hi,
I know I can specify an SMTP server in the web.config file in ASP.NET 2.0 like this
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="username" password="password" />
</smtp>
</mailSettings>
</system.net>
My question is it possible to set multiple SMTP servers and programmatically select which one I want to use? I may want to send mail from different addresses for instance and my mail server requires my username to be username@domain.com, so if I wanted to send mail from different addresses I would need to set the web.config file like so...
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="email1@domain.com" password="password1" />
</smtp>
<smtp deliveryMethod="Network">
<network host="mail.domain.com" port="25" userName="email2@domain.com" password="password2" />
</smtp>
</mailSettings>
</system.net>
Thing is it won't let me do this because the <smtp> element can't be repeated. Any ideas? Cheers!
Sunday Ironfoot
|
|
|
|
|
hai every one
im using sesson event.in gridview i have a checkbox.if i check that the bounded data stored in the sesson.so how can i store for multiple data in sesson.plz any one help me
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
hi guys
i have question about how to update, save and retrieve the appsettings and connectionsettings on the web.config file in asp.net 2.0 C#?
thanks
|
|
|
|