Hi
I was trying to do a little dot net proj to list all sp's and their
definitions:
sProcName = CStr(lstSP.Items.Item(lCount))
cmd = New SqlCommand("sp_HelpText", cn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@objname", sProcName)
dr = cmd.ExecuteReader
If dr.Read Then
sCreate = ""
iPosnText = dr.GetOrdinal("Text")
Do
sLine = CStr(dr.GetSqlString(iPosnName).Value)
sCreate = String.Concat(sCreate, sLine)
Loop Until Not dr.Read
lblSP.Text = sAlter
lblSP.Refresh()
Write(iFileHandle, sCreate)
End If
dr.Close()
what happens is that text is nvarchar
i get back where [] is an undisplayable char
"[] create procedure ...
this seems to me to be a unicode string?
how to I get it into a text string? - I've tried .tostring, cstr()
please (oh and please dont retire the list)
Many thanks
Ian
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.