显示标签为“lots”的博文。显示所有博文
显示标签为“lots”的博文。显示所有博文

2012年3月29日星期四

Display 1 piece of Data from a SQLDataSource

I have the following sqlDataSource. I wan't to display one piece of data, not a whole row, from it. I can find lots of information on putting it into a datagrid, but nothing on puttin one piece in a textbox. I cannot use a formview as we are embedding html in response.write and it breaks in a formview. Thanks.

<asp:SqlDataSourcerunat="server"

ID="myEmpInfo"

SelectCommand="Select di.EmpInfo,di.eth,gc.t_level

From tblEmp di

,tblMisc gc

Where di.empnum = @.empnum

and di.empnum = gc.empnum"DataSourceMode="DataReader"ConnectionString="<%$ ConnectionStrings : myConnectionString %>">

<SelectParameters>

<asp:QueryStringParameterName="empnum"QueryStringField="empnum"/>

</SelectParameters>

</asp:SqlDataSource>

Hi,

Do you want to get the value of specific row and specific column from a table? If so,you can use DataView to achieve. See the following sample:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet" ConnectionString="<%$ ConnectionStrings:TestConnectionString2%>" ></asp:SqlDataSource>
SqlDataSource1.SelectCommand ="select CategoryName from Categories";DataView dw = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
 
/// Display all the valueforeach (DataRow drin dw.Table.Rows) {foreach (DataColumn dcin dw.Table.Columns) { Response.Write(dr[dc.ToString()].ToString() +";"); } Response.Write("\r\n"); }/// You also can use /// string str = dw.Table.Rows[0][0].ToString(); /// to get the value from a specific row specific column.
Hope that helps. Thanks.

2012年3月8日星期四

Disappering users

Hello.

I have an SQL 2000 OLAP (SP4) project with lots of dimensions, mesures, cubes, roles and users. Everything was fine for a year till yesterday. I've added a user (did it time to time before) to a role. As I process the cube the user was removed from the role. Now I can not add anyone. Am planning to remove everyone and add again. But also scared of adding nobody forever.

Help. Thanks.

I wonder if perhaps one or more of the users in some of the roles are no longer valid in the domain? I would suggest making a backup of your database and then perhaps by removing the roles and re-adding the (valid) users you'll get back to a good state.

Hope that helps.