|
Hi
Vuyiswa
I Checked in https but their also am getting same error
when I remove all the code except credential then I did not get any error after that I changed my privies code to
Imports JBillingWebReff<br />
Imports com.rephero.billing<br />
Imports com.rephero.billing.UserWS<br />
Imports com.rephero.billing.WebServicesSessionLocalService<br />
<br />
Partial Class JBillingWebReff<br />
Inherits System.Web.UI.Page<br />
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
Dim service As WebServicesSessionLocalService = New WebServicesSessionLocalService()<br />
Dim userName As String = "jbajin"<br />
service.Credentials = New Net.NetworkCredential("webapp", "r3ph3r0-b1ll1ng")<br />
Dim userIdParams As String = "jbajin"<br />
Dim result As String<br />
result = service.getUserId(userIdParams)<br />
<br />
Response.Write(result)<br />
<br />
End Sub<br />
End Class<br />
this is first time am working with this type of web service(java) please help me
Thank you
Shivashankar.C
The Value Has Its Value Only Its Value Is Valied
|
|
|
|
|
I am fetching 50,000 records from database.when records are fetched it tooks some time.I want to add a button named stop in application , so that when user clicks that button,app will stop.But this will show while fetching records.
Hope u understand my problem.
Any help will greatly be appreciated.
Thanks
|
|
|
|
|
First of all, 'help' is hardly a unique subject line. Everyone here wants help.
To do this at all, you need to make your DB call in another thread. Then you can kill that thread if you want to, but you won't be able to use the built in stuff to cancel the thread, because what you want to cancel is a single action, you'd need to find a more nasty way of doing it ( such as killing the thread ).
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Firstly tell us how you fetch those records and where are you displaying those records , the problem might be the way you display them.please show the code where you retrieve your data.
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am able to create a table with some columns in an Excel file & I can add or read data from those columns. But when I try to add a new column (NewInfo) with the following codes ... I had an error "Invalid operation" after line cmd.CommandText = "ALTER TABLE ..."
<br />
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)<br />
conn1.Open()<br />
<br />
Dim cmd As New System.Data.OleDb.OleDbCommand()<br />
cmd.Connection = conn1<br />
<br />
cmd.CommandText = "ALTER TABLE EmployeeData ADD NewInfo VARCHAR(20) NULL"<br />
<br />
cmd.ExecuteNonQuery()<br />
conn1.Close()<br />
Might someone show me what is wrong?
Thank in-advance
|
|
|
|
|
ATC wrote: cmd.CommandText = "ALTER TABLE EmployeeData ADD NewInfo VARCHAR(20) NULL"
cmd.ExecuteNonQuery()
conn1.Close()
Might someone show me what is wrong?
The Excel driver doesn't support the "ALTER TABLE" SQL statement. You have to add the columns using the Excel object model.
|
|
|
|
|
Thank for the explaination, now I know why it has not work!
Would you kindly provide some links to use the Excel object model. I appreciate a lot!
Many thanks
|
|
|
|
|
|
Hi,
I'm trying to save save a user preference via a cookie. This should be simple, right? Not!
To set the cookie, I use the following code:
Response.Cookies("TestCookie").Value = "test"
Response.Cookies("TestCookie").Expires = DateTime.Now.AddYears(30)
I then have another page - in the same project and domain - where I try to retrieve the cookie:
response.write("Cookie value is: " & Response.Cookies("TestCookie").Value)
This returns a null value for the cookie.
What am I doing wrong?
Thanks,
Kevin
|
|
|
|
|
First you should check wether the browse supports cookies and has cookies enabled
If Request.Browser.Cookies Then
Then you should check wether the cookie is available, or if you want to create a new cookie... create a cookie
' Create a new cookie<br />
HttpCookie hcMyCookie = new HttpCookie("TextCookie", "test")<br />
' set expiration date<br />
hcMyCookie.Expires = DateTime.Now.AddMonths(1)<br />
Now you have your cookie, but don't forget to send it back to the visitor...
Response.Cookies.Add(hcMyCookie)
And then close the 'If' section
End If
|
|
|
|
|
Eduard,
Thanks. Your example - with a few modifications - works for the session, but not when the user returns to the page.
If Request.Browser.Cookies Then
' Create a new cookie
Dim hcMyCookie As New HttpCookie("TestCookie", "test")
' set expiration date
hcMyCookie.Expires = DateTime.Now.AddMonths(1)
Response.Cookies.Add(hcMyCookie)
Else
Response.Write(" Cookies not supported ")
End If
Response.Write(Response.Cookies("TestCookie").Value)
If I set the cookie and then comment out all the above code except for the last line, the cookie goes away. It seems that the cookie only lasts for the session. How do I get the cookie to last longer than that?
Thanks
|
|
|
|
|
I figured it out...
The following code retrieves the value of the cookie:
Dim cookieCols As New HttpCookieCollection
cookieCols = Request.Cookies
Response.Write(cookieCols(0).Value)
|
|
|
|
|
Tip: since cookiecols is receiving a value... no need to create a new instance before it receives a value (remove NEW)
Dim cookiecols as httpcookiecollection = Request.Cookies
Response.Write(cookieCols(0).Value)
unless you plan on doing something else with cookiecols no need to create that variable either
Response.Write(Request.Cookies(0).Value)
Just trying to help
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
I have a problem with my code that I need help on. I think I know what the problem is just not how to fix it.
Here it is: Background:
I am programming a barecode scanner that accesses network files. I am coding a way to save the files locally when the next work is down. I successfully save the files locally and put a link on the mainmenu that signals to the user that there are local files that need to be uploaded to the network. When the user clicks on the link the program trys to write to the network files.
Here is the problem. When I have network access and click on the link it says that the local file is in use. But if I minimize program window and then bring it up again, it works. Is this refreshing the form or something. I tried a refresh (I think) and it did not work.
Does anyone know what I can do?
|
|
|
|
|
Cory Kimble wrote: When I have network access and click on the link it says that the local file is in use.
What file?? How is it written?? What does the code you use to do this look like?? Are the files being closed properly?? Are you Disposing stream objects after you're done with them??
Cory Kimble wrote: But if I minimize program window and then bring it up again, it works.
Minimizing a form forces a garbage collection which may explain this. It sounds like you're not dispoing of some resource properly after you're done with it.
|
|
|
|
|
Disposing stream objects after I am done with them? I do a .close .dispose is not available. How do I dispose of it? I am using .net compact framework.
|
|
|
|
|
Cory Kimble wrote: Disposing stream objects after I am done with them? I do a .close .dispose is not available.
Whoops! My bad. I've been hanging around with the Graphics classes too much today.
There is no Dispose on the streams. You just Flush (if needed) and Close them. But, from the sounds of your problem, it appears that a stream isn't getting closed.
What files are these?? Images?? What does the code look like that's reading/writing them??
|
|
|
|
|
Hi Dave,
AFAIK a Flush() is implied by a Close(), so it makes no sense to explicitly Flush()
just before a Close(). The only time Flush() is useful is when you don't intend
to Close() but instead just want to make sure everything up till then is actually
written to the file before you continue.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I try to write to file on network
Try
swship = New StreamWriter(shipFile, True)
swship.WriteLine(frmShip.cmbobxLocation.Text + "," + frmShip.txtbxScanID.Text + "," + frmShip.cmbobxBuyer.Text + "," + dt.ToString("d"))
swship.Close()
Catch ex As Exception
writeLocal()
End Try
WriteLocal:
Try
Dim swshipCatch As StreamWriter = New StreamWriter(localShipFile, True)
swshipCatch.WriteLine(frmShip.cmbobxLocation.Text + "," + frmShip.txtbxScanID.Text + "," + frmShip.cmbobxBuyer.Text + "," + "," + dt.ToString("d"))
swshipCatch.Flush()
swshipCatch.Close()
Catch ex As Exception
MessageBox.Show("writeLocal failed")
End Try
The above all works Fine.
The Below is when I attempt to access the localShipFile
Try
'SHIP
frmsr = New StreamReader("program files\steidingerfoodsce\localship.txt")
frmsw = New StreamWriter("\\lit3\device\ship.txt", True)
Do While frmsr.Peek() >= 0
frmsw.WriteLine(frmsr.ReadLine())
Loop
frmsr.Close()
frmsw.Close()
file.ReWriteSHIPFile() This is where it fails!!!
MessageBox.Show("SHip done")
Catch ex As Exception
MessageBox.Show(ex.ToString)
MessageBox.Show("Network connection not established")
End Try ReWriteSHIPFIle()
Public Sub ReWriteSHIPFile()
dim swship as streamwriter = New StreamWriter(localShipFile, False) ----It fails when this line executes.
swship.Write("")
swship.Close()
End Sub
modified on Monday, March 24, 2008 4:20 PM
|
|
|
|
|
Cory Kimble wrote: frmsr = New StreamReader("program files\steidingerfoodsce\localship.txt")
You're really using a hard-coded path that assumes the current directory is C:\ ?? Change this to use a fully qualified path built from known sources, such as Application.StartupPath , the System.Io.Path class, and other methods of determining the true path to well-known folders.
|
|
|
|
|
Hi Cory,
if it still does not work, just show us the code with all the opens, writes,
flushes, closes, disposes, what have you.
BTW: please use PRE tags (not CODE tags) for multi-line code snippets; they
preserve formatting such as indentation, much easier to read.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I try to write to file on network
Try
swship = New StreamWriter(shipFile, True)
swship.WriteLine(frmShip.cmbobxLocation.Text + "," + frmShip.txtbxScanID.Text + "," + frmShip.cmbobxBuyer.Text + "," + dt.ToString("d"))
swship.Close()
Catch ex As Exception
writeLocal()
End Try
WriteLocal:
Try
Dim swshipCatch As StreamWriter = New StreamWriter(localShipFile, True)
swshipCatch.WriteLine(frmShip.cmbobxLocation.Text + "," + frmShip.txtbxScanID.Text + "," + frmShip.cmbobxBuyer.Text + "," + "," + dt.ToString("d"))
swshipCatch.Flush()
swshipCatch.Close()
Catch ex As Exception
MessageBox.Show("writeLocal failed")
End Try
The above all works Fine.
The Below is when I attempt to access the localShipFile
Try
'SHIP
frmsr = New StreamReader("program files\steidingerfoodsce\localship.txt")
frmsw = New StreamWriter("\\lit3\device\ship.txt", True)
Do While frmsr.Peek() >= 0
frmsw.WriteLine(frmsr.ReadLine())
Loop
frmsr.Close()
frmsw.Close()
file.ReWriteSHIPFile() This is where it fails!!!
MessageBox.Show("SHip done")
Catch ex As Exception
MessageBox.Show(ex.ToString)
MessageBox.Show("Network connection not established")
End Try
ReWriteSHIPFIle()
Public Sub ReWriteSHIPFile()
dim swship as streamwriter = New StreamWriter(localShipFile, False) ----It fails when this line executes.
swship.Write("")
swship.Close()
End Sub
|
|
|
|
|
Cory Kimble wrote: Try 'SHIP frmsr = New StreamReader("program files\steidingerfoodsce\localship.txt")
You're really using a hard-coded path that assumes the current directory is C:\?? Change this to use a fully qualified path built from known sources, such as Application.StartupPath, the System.Io.Path class, and other methods of determining the true path to well-known folders.
|
|
|
|
|
Does Application.StartPath work in .net compact framework?
|
|
|
|
|
Cory Kimble wrote: Does Application.StartPath work in .net compact framework
Nope, not supported. You can find out what is and isn't supported in the .NET Framework documentation. Everything with a small phone-looking icon next to it is supported by the Compact framework. Click[^]
|
|
|
|