|
I have implemented form authentication on SSRS and am trying to use it in my web application using SOAP APIs.
I am able to call the logonuser method with the reportserver proxy class with cookie management on loggin in my web application using the SOAP APIs.
But after authentication when I move to next page and try to access the
listchildrens method of reporting service I get the "Object moved to " error.
I want to know how to pass credentials to reporting service so that it allows
me to access the same accross my application.
Dim rsobj As New RS.ReportingService
rsobj.Url = "http://localhost/reportserver/ReportService.asmx"
' Return a list of catalog items in the report server database
Dim items As RS.CatalogItem() = rsobj.ListChildren("/", True)
|
|
|
|
|
hi
i am new in vb.net and now i am learning sql and i have create one small application with sql and in table there are two columns one is imageID and second one is Image
i can save and delete image with sql database but problme is when i add or delete image is dosent shows changes i mean if i add second image in to database but it still shows there is one image in database but if i close application and re run it then it shows there is two images in database so i am not sure but it looks like i need to refresh some thing but i dont know what
is it possible to help me with this issue ?
this is my code
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Public Class Form1
Private mImageFile As Image
Private mImageFilePath As String
Dim CurrentImage As Integer
Dim SelectedImage As String
Dim Img As String
Private Function GetDBConnection()
' Compose the database file name.
' Modify this if the database is somewhere else.
Dim DBname As String = Application.StartupPath()
DBname = DBname.Substring(0, DBname.LastIndexOf("\bin"))
DBname = DBname & "\Images.mdf"
' Compose the connect string.
Dim connect_string As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=" & _
DBname & ";Integrated Security=True;User Instance=True"
' Open a database connection.
Dim SqlConn As New Data.SqlClient.SqlConnection(connect_string)
SqlConn.Open()
' Return the connection.
Return SqlConn
End Function
Private Sub LoadImages()
dsImage.Clear()
Try
conImage = GetDBConnection()
daImage.Fill(dsImage, "Images")
Catch ex As Exception
MsgBox(ex.Message)
End Try
conImage.Close()
conImage.Dispose()
Call PoChng()
End Sub
Private Sub PoChng()
If Me.ImagesBindingSource.Count = 0 Then
Label1.Text = "Empty Database"
Else
Label1.Text = (Me.ImagesBindingSource.Position + 1).ToString & " Of " & _
(Me.ImagesBindingSource.Count).ToString
End If
End Sub
Private Sub MoNext()
Me.BindingContext(dsImage, "Images").Position = Me.BindingContext(dsImage, "Images").Position + 1
Me.ImagesBindingSource.Position = Me.ImagesBindingSource.Position + 1
Call PoChng()
End Sub
Private Sub MoPre()
Me.BindingContext(dsImage, "Images").Position = Me.BindingContext(dsImage, "Images").Position + 1
Me.ImagesBindingSource.Position = Me.ImagesBindingSource.Position - 1
Call PoChng()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
picImage.Image = Nothing
txtImageFile.Text = ""
txtTitle.Text = ""
OpenFileDialog1.ShowDialog()
Dim sFilePath As String
sFilePath = OpenFileDialog1.FileName
If sFilePath = "" Then Exit Sub
If System.IO.File.Exists(sFilePath) = False Then
Exit Sub
Else
txtImageFile.Text = sFilePath
mImageFilePath = sFilePath
End If
End Sub
Private Sub GetImage()
Dim fs As FileStream = New FileStream(mImageFilePath.ToString(), FileMode.Open)
Dim img As Byte() = New Byte(fs.Length) {}
fs.Read(img, 0, fs.Length)
fs.Close()
mImageFile = Image.FromFile(mImageFilePath.ToString())
Dim imgHeight As Integer = picImage.Height 'mImageFile.Height
Dim imgWidth As Integer = picImage.Width 'mImageFile.Width
Dim imgLength As Integer = mImageFile.PropertyItems.Length
Dim imgType As String = Path.GetExtension(mImageFilePath)
mImageFile = Nothing
' image content
Dim pic As SqlParameter = New SqlParameter("@pic", SqlDbType.Image)
pic.Value = img
commImage.Parameters.Add(pic)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'get sql connection
Try
conImage = GetDBConnection()
Dim sSQL As String = "INSERT INTO Images (Pic) VALUES(@pic)"
commImage = New Data.SqlClient.SqlCommand(sSQL, conImage)
Call GetImage()
commImage.ExecuteNonQuery()
'Me.ImagesTableAdapter.Update(Me.dsImage.Images)
MessageBox.Show("Image successfuly saved in database", "Image Load")
Catch ex As Exception
MsgBox(ex.Message)
End Try
commImage.Dispose()
' commImage = Nothing
conImage.Close()
conImage.Dispose()
Call LoadImages()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
SelectedImage = ("DELETE FROM Images WHERE ImageID = " & txtImageFile.Text)
conImage = GetDBConnection()
Try
commImage = New Data.SqlClient.SqlCommand(SelectedImage, conImage)
commImage.ExecuteNonQuery()
' Me.ImagesTableAdapter.Update(Me.dsImage.Images)
MsgBox("Image successfuly deleted from database", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox(ex.Message)
End Try
commImage.Dispose()
commImage = Nothing
conImage.Close()
conImage.Dispose()
Call LoadImages()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call LoadImages()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Call MoPre()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Call MoNext()
End Sub
i have drag and drop these
sql adapetr
sql connection
sql command
i have no problem with save and delete and i dont know which part of code do i need to post so i am posting all code here
waiting for your kind rep.
have a nice day
thank you
|
|
|
|
|
I'm not sure, but I think somewhere along the line in FillImages you need to rebind your datasource (Me.ImagesBindingSource).
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello sir
First of all thanks for your kind rep.
as you said i have tried but still same problem so i dont know what to do now
this is what i have done
Private Sub LoadImages()
dsImage.Clear()
Try
conImage = GetDBConnection()
daImage.Fill(dsImage.Images)
Me.ImagesBindingSource.ResetCurrentItem()
Catch ex As Exception
MsgBox(ex.Message)
End Try
conImage.Close()
conImage.Dispose()
Me.ImagesBindingSource.ResetBindings(True)
Call PoChng()
End Sub
and i have also try to put this bold and underline code in several different place but it's not doing any thing
so could you please tell me what to do now
waiting for your kind rep.
have a nice day
|
|
|
|
|
Hello,
Which edition (desktop / professional )of SQL server 2000 I can install on Windows XP Sp2 operating system and from where can I get free download.
Thanks in adavance for your help.
Regards,
S Kumar
Thanks & Regards,
Kumar
|
|
|
|
|
It's called MSDE - Microsoft Desktop Engine. You can download from the MS site here[^]
|
|
|
|
|
Hi Folks
I wonder if anyone has any ideas that could help me. I've written an application in VS 2005. I use Inno Setup for Installation, which I have used previously with success.
When I go to install the program on another machine I get the following error
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)
I've checked my Sql Area Configuration and can confirm that I allow remote connections although via using TCP/IP only and have also tried TCP/IP and named pipes.
I've checked the SQL Browser and this is also running.
I've checked my Connection strings and these are fine.
Can someone help please?
Thanks alot.
Kris MCP
|
|
|
|
|
|
Hi Still no go I'm afraid.
I went to IP Addresses and checked all enabled. I've kept it so I can enable Dynamic ports as a little unsure of this.
Kris MCP
|
|
|
|
|
Any firewall between the servers?
|
|
|
|
|
Hi
There shouldn't be. I've been into the Windows Firewall and put all SQL to be allowed under exceptions.
Kris MCP
|
|
|
|
|
hi, I'm practicing how to use sql language in vb 6.0 via ADODC. I'm getting problem with adding a data in INSERT INTO statement. Because my code in the command buttons is just...
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
but the data in the textbox are not saved in the data base...
can you help me please.
|
|
|
|
|
Did you try with Connection object
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
OR also you can it with Command object
OR
Try your way
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.Refresh
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
i've tried the
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.Refresh
but there was an error saying "Operation is not allowed when the object is closed" . what should i do?
|
|
|
|
|
Do you have an open connection to the database? Doesn't sound like it from that error message.
|
|
|
|
|
how can I open the connection to the database??
|
|
|
|
|
(1)
Before going to execute any query first check your database connection is open or close.
(2) Did you try with connection object :
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
yup, I've tried it and it worked but I've also change my data base connection using stored procedure.
Thanks for the help.
|
|
|
|
|
I am not getting this point : "but I've also change my data base connection using stored procedure" ?
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Instead of using the ADODC. I've changed the connection to this
Private nameConn As ADODB.Connection
Private nameCMD As ADODB.Command
Private nameRST As ADODB.Recordset
Private Sub ConnectTODB()
Set nameConn = New ADODB.Connection
nameConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\meki\meki training\dbnames.mdb"
nameConn.Open
Set nameCMD = New ADODB.Command
Set nameCMD.ActiveConnection = nameConn
End Sub
so that the nameComm.Execute command will work.
|
|
|
|
|
Oh! Good
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Hi all
in sql2005 when u create table and make a primary key column in the table sql automaticaly make on this column clusterd index
my question is i want to make a composite clusterd index which contain the primary key and another columns
when i make that as all know i meet the problem say there is one clusterd index in the table so i can't create another one ......
and when i delete the primary key and make the composite clusterd index it work but i want to recreate the primary key on the one spacifed column
when i make that sql told me it'll remove the latest composite clustered index to make the primary key as clustered index
how can i fix this problem plz
and thnx for advice
Kareem Elhosseny
|
|
|
|
|
What you can do is remove the primary key - make the (custom) clustered index as you want it - and then reassign the primary key.
This will make the primary key's index non-clustered and allowing you to have your custom clustered index.
|
|
|
|
|
Dear Alsvha
thnx for your advice at the first but i try wht u advice me but it not working when i remove the primary key and make the clustered index as i want then when i reassign the primary key sql remove the clustered index wht i
make before to create the clustered index for the primary key column
u can add me for more communication
kareem_elhosseny@hotmail.com
see u soon with my all greeting .
Kareem Elhosseny
modified on Sunday, June 8, 2008 3:13 AM
|
|
|
|
|
Haven't had that happen in any version of SQL Server 2005 I've worked with.
I've never had problems with creating a custom clustered index in that way. Are you sure you made the Clustered index correct and not accidentally selected "non-clustered"?
What happens if you script the creation?
<br />
CREATE TABLE [YOUR_TABLE](<br />
[YOUR_TABLE_DEFINITION]<br />
CONSTRAINT [YOUR_INDEX_NAME] PRIMARY KEY NONCLUSTERED <br />
(<br />
[PRIMARY_KEY_COLUMN] ASC<br />
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />
) ON [PRIMARY]<br />
Do you get a non-clustered index now?
|
|
|
|