1
Answer

Moving items from one listbox to another listbox...please read my requirement

Hi,

friends


I have a requirement in my site that is


I have two tables that is main branch and subbranch
main branch table contain businessid and businessname columns

subbranch table contain businessid and subbranchid and subbranchname

in this businessid in mainbranch table primarykey and subbranch table forienkey...


i have a list box in that listbox i attached businessname and subbranchname according to businessid as a treestructure
that is businessname is parent and subbranchname is child  like wise i attached some items

actually my requirement is if i select anyone that is parent or child that will be moved to another list box ....
if i select parent and click button that businessname and subbranchname will be moved to another list box

ex

listbox1                             listbox2

+mainbranch1                 +mainbranch1
  -subbranch1  - subbranch1
+mainbranch2
 -subbranch2         >>      

if i select mainbranch1 and click on the button that will be moved to another listbox see above......

please give me the code for this one any one can help me ....please........................


alredy i search i am not getting relevent code for this one....please give me the code.......
Answers (1)
0
Rams

Rams

NA 44 36.3k 13y
this also didnot work. Thanks for your fast reply. iam stuck up with the following error :

"system.net.webexception:the remote server returned an error 417 expectation failed
 at MBS.SmsMgr.SendSMS(Object stringPost)
   at MBS.Dispatcher.CommonProcedures.SendSMS(CommonProcedures objparams)".

Please do find the code below :




Public Function SendSMS(ByVal stringPost As System.Object) As String Implements ISmsMgr.sendSMSDim strReturnValue As String = String.EmptyDim objWebRequest As HttpWebRequest = Nothing


Dim objWebResponse As HttpWebResponse = Nothing


Dim objStreamWriter As StreamWriter = Nothing


Dim objStreamReader As StreamReader = Nothing


Try




Dim strProxyURL As String = String.EmptyDim iProxyPort As Integer = 0If Not ConfigurationManager.AppSettings.Item("ProxyURL") Is Nothing Then

strProxyURL = ConfigurationManager.AppSettings.Item(



"ProxyURL").ToString.TrimEnd If


If Not ConfigurationManager.AppSettings.Item("ProxyPort") Is Nothing Then

iProxyPort =


CInt(ConfigurationManager.AppSettings.Item("ProxyPort").ToString.Trim)End If




Dim strSMSDialerConnectionName As String = ConfigurationManager.AppSettings("SMSDialerConnectionName")Dim iAvailConType As Integer = DetectConnection()If iAvailConType = enmConnectionType.NOTCONNECTED Then ' If not connected,


'Then detect the Modem connection and Dialp up.


If Not String.IsNullOrEmpty(strSMSDialerConnectionName) Then




Dim chSplit() As Char = {";"}Dim strDialeConnections() As String = strSMSDialerConnectionName.Split(chSplit)If strDialeConnections.Length > 0 Then



For i = 0 To strDialeConnections.Length - 1If DialupConnection(strDialeConnections(i)) Then

iAvailConType = enmConnectionType.MODEM

strProxyURL =

iProxyPort = 0


String.EmptyIf Not ConfigurationManager.AppSettings.Item("DailUpProxyURL") Is Nothing Then

strProxyURL = ConfigurationManager.AppSettings.Item(


"DailUpProxyURL").ToString.TrimEnd If


If Not ConfigurationManager.AppSettings.Item("DailUpProxyPort") Is Nothing Then

iProxyPort =


CInt(ConfigurationManager.AppSettings.Item("DailUpProxyPort").ToString.Trim)End If


Exit For


End If


Next


End If


End If


End If


If iAvailConType <> enmConnectionType.NOTCONNECTED Then



objWebRequest =


Dim bytesToSend As Byte() = Encoding.UTF8.GetBytes(stringPost)Dim strSMSApi As String = ConfigurationManager.AppSettings.Item("SMSApi").ToStringDirectCast(WebRequest.Create((strSMSApi & "?") + stringPost.ToString()), HttpWebRequest)'add eventvwr : laxman

EventLog.WriteEntry(


"SENDSMS.strSMSApi ", (strSMSApi & "?") + stringPost.ToString())'(strSMSApi & "?") + stringPost.ToString()

objWebRequest.Method =

"POST"


If (Not String.IsNullOrEmpty(strProxyURL.Trim)) Then

objProxy =

objProxy.Credentials = CredentialCache.DefaultNetworkCredentials

objWebRequest.Proxy = objProxy


New WebProxy(strProxyURL, iProxyPort)End If

objWebRequest.ContentLength = bytesToSend.Length

objWebRequest.ContentType =

"application/x-www-form-urlencoded"

objStreamWriter =

objStreamWriter.Write(stringPost)

objStreamWriter.Flush()

objStreamWriter.Close()

objWebResponse =

objStreamReader =

strReturnValue = objStreamReader.ReadToEnd()

objStreamReader.Close()

New StreamWriter(objWebRequest.GetRequestStream())DirectCast(objWebRequest.GetResponse(), HttpWebResponse)New StreamReader(objWebResponse.GetResponseStream())

0
Priya Linge

Priya Linge

NA 5k 708.3k 13y
Hi Ram,

Please see below link.

http://code.google.com/p/duplicati/issues/detail?id=378.

Hope it will help you to solve the error.

Thanks.
0
Rams

Rams

NA 44 36.3k 13y
Hi,

Thanks for the reply.. we tested the same service in our network..it is showing succesfull..but the client is using a proxy server which i think is creating a problem..
0
Zoran Horvat

Zoran Horvat

NA 5.7k 516.3k 13y
Can you read HttpWebRequest's Expect property and paste it here? That should be the root cause of the problem - web request is sending something in the Expect HTTP header and remote Web server is unable to comply so it responds with 417 error.

Give us precise Expect value you're sending.

Zoran