<%
String user=request.getParameter("LedgerName");
ResultSet rs=st.executeQuery("SELECT RoomMasterID,RoomNo FROM RoomMaster AS RM, LedgerMaster AS LM WHERE RM.LedgerID = LM.LedgerID AND LedgerName = '" & Me.datRoomType.SelectedItem.Text & "' AND  RM.Status <> 'NO' AND RoomMasterID NOT IN (SELECT DISTINCT RoomMasterID FROM BookingMaster WHERE ' " & Me.datarrivaldate.AmericanDate & " 'BETWEEN FromDate AND ToDate) AND RoomMasterID NOT IN (SELECT  DISTINCT RoomMasterID FROM BookingMaster WHERE ' " & Me.datdeparturedate.AmericanDate & " ' BETWEEN  FromDate AND ToDate)");
<%
String user=request.getParameter("LedgerName");
ResultSet rs=st.executeQuery("SELECT RoomMasterID,RoomNo FROM RoomMaster AS RM, LedgerMaster AS LM WHERE RM.LedgerID = LM.LedgerID AND LedgerName = '" & Me.datRoomType.SelectedItem.Text & "' AND  RM.Status <> 'NO' AND RoomMasterID NOT IN (SELECT DISTINCT RoomMasterID FROM BookingMaster WHERE ' " & Me.datarrivaldate.AmericanDate & " 'BETWEEN FromDate AND ToDate) AND RoomMasterID NOT IN (SELECT  DISTINCT RoomMasterID FROM BookingMaster WHERE ' " & Me.datdeparturedate.AmericanDate & " ' BETWEEN  FromDate AND ToDate)");

Is this javascript or java:

AND LedgerName = '" & [B]Me.datRoomType.SelectedItem.Text[/B] & "'

?