I'm using vs 2008. This is being run on a new sql 2008 server r2(a new full install). I have a dropdownlist that I am populating using the following code:
strServerString ="Data Source=MC22JWS;Initial Catalog=Shops;Integrated Security=True;uid=MC90APP;pwd=MC90@0101"
strConnect = strServerString
' Open the Connection
Dim Con As New System.Data.SqlClient.SqlConnection(strConnect)
Con.Open()
' Open the Connection
strsql = "exec Shops_Get_Projects "
Dim qjbCmd As New System.Data.SqlClient.SqlCommand(strsql, Con)
Dim rdr As System.Data.SqlClient.SqlDataReader = qjbCmd.ExecuteReader()
' Populate the Projects dropdown Control
While rdr.Read()
Dim newListItem As New ListItem()
newListItem.Text = rdr.GetString(0)
newListItem.Value = rdr.GetString(0)
DropProjects.Items.Add(newListItem)
End While
rdr.Close()
Con.Close()
When I run this, the dropdown popluates with nothing. If I run the same code against my local sql server, everything is fine. I have uninstalled the .net framework and reinstalled it and it still doesn't populate the dropdown. I have run this same code on 3 or 4 other sql servers and not had any problems. Is the SQL install bad?
Thanks
Cathy
strServerString ="Data Source=MC22JWS;Initial Catalog=Shops;Integrated Security=True;uid=MC90APP;pwd=MC90@0101"
strConnect = strServerString
' Open the Connection
Dim Con As New System.Data.SqlClient.SqlConnection(strConnect)
Con.Open()
' Open the Connection
strsql = "exec Shops_Get_Projects "
Dim qjbCmd As New System.Data.SqlClient.SqlCommand(strsql, Con)
Dim rdr As System.Data.SqlClient.SqlDataReader = qjbCmd.ExecuteReader()
' Populate the Projects dropdown Control
While rdr.Read()
Dim newListItem As New ListItem()
newListItem.Text = rdr.GetString(0)
newListItem.Value = rdr.GetString(0)
DropProjects.Items.Add(newListItem)
End While
rdr.Close()
Con.Close()
When I run this, the dropdown popluates with nothing. If I run the same code against my local sql server, everything is fine. I have uninstalled the .net framework and reinstalled it and it still doesn't populate the dropdown. I have run this same code on 3 or 4 other sql servers and not had any problems. Is the SQL install bad?
Thanks
Cathy