|
Hello.
I have a web app that is a directory where users log in. From there they select applications they want to run and based on that thye are directed to the appropriate server. How can I retain the login information when the user is directed to another server?
Thanks,
JP
JP011
|
|
|
|
|
I want to add a search box on my Site that searches in the from specific column of a database..
Suppose the table consists of columns NAME OF BOOK,PUBLISHER,CATEGORY,FORMAT. it should be like this
searchbox
(User Input)
dropdownlist(to search in specific column)
1)Name of book
2)Publisher
3)category
resulting gridview control must contain the results with all the columns
iam a beginner...
|
|
|
|
|
if you are using DataSet to fill the GridView
thant call your DataSet in DataView class and your filter property to filter the data.
if you are using ObjectDatasource then you can define filterexpression of object data source.
I havn't used SqlDatasource you need to study ..
Naveed Kamboh
|
|
|
|
|
please explain a bit..iam a beginner
|
|
|
|
|
If you are beginner then please Read and make sample programs
go to ASP.Net and watch some videos.
Naveed Kamboh
|
|
|
|
|
Hi,
Follow the steps below: Create a following stored Procedure in SQL Server 2000/2005. Give the table name(In the Procedure) you want to query
<font color="blue"><br />
CREATE PROCEDURE [dbo].[TEST_PARAM] <br />
<br />
@Param varchar(100)<br />
AS<br />
BEGIN<br />
declare @dynamicQuery NVARCHAR(4000)<br />
set @dynamicQuery = 'Select ' + @Param + ' from TABLE_NAME '<br />
exec sp_executesql @dynamicQuery<br />
END<br />
</font>
2> This above store procedure will return all the values in the column you passed as a parameter.
3> On the server click of the Search button call this stored procedure by passing the columnName as in the table as a parameter and fill the values returned by the stored procedure in a DataSet ds.
4> Any have you know the columnName the user selected, use the same name in the select filter, like:
<br />
<font color="blue"> <br />
GridView1.DataSource = ds.Tables[0].DefaultView.RowFilter = "ColumName = '" + txtSearchBox.Text.Trim()+ "'";<br />
</font>
5> Then the the grid View will be binded with the needed values.
Thatz it.
M-o-h-a-n
|
|
|
|
|
Hi there,
I’m hoping someone can offer their expert opinion on a problem I am having at work with an ASP.net developer.
I come from a classic asp background, and a new project at work required us to have our existing site (currently in asp with access database) re-developed in .net.
We hired the contractor a few months ago to develop a website. Unfortunately due to the nature of our business, there isn’t a set-in-stone development plan.
Anyway, since hiring him, i have been trained in .net (I am now MCP in windows application development)
I have concerns that he doesn’t know fully what he’s doing.
For example, I asked to see his code a while ago, and when he showed me it, there was no project file… just a folder full of .aspx and .vb files.
I anticipated him creating a class library, within a solution and then a web project within that solution.
There will also be windows applications associated with this project, which at the moment, quite frankly, I am far too frightened develop them!!
Please can the experienced asp.net developers amongst you let me know what you think… im foreign to the concept of not having a project file, or solution or anything.
Theres also several issues with the sql 2000 databae, replicated data etc… however im less concerned with that, as I can fix those issues.
Any advice anybody can give is greatly received, stuck in a definite rut here.
|
|
|
|
|
Well it really depends which IDE your developoer is using.
If he is using Visual Studio or web Matrix then there would be a project file
if he is using note pad or Dreamweaver then there won't be any.
There is an option of keeeping .vb or .cs file in the same .aspx for example
News.aspx
you can have News.aspx and News.vb or News.cs file separate or you can have both in one file .aspx
by default there would two files. (these files are in same folder)
To add business layer or Data Access layer or you can use class file which mus be in App_Code folder.
To add databae there is App_data folder and there are some other folders too.
So i'll suggest do not judge him on the bases which you have descriibed.
Judege him on the basis of site performance.
Naveed Kamboh
|
|
|
|
|
thisnamesux wrote: For example, I asked to see his code a while ago, and when he showed me it, there was no project file… just a folder full of .aspx and .vb files.
With ASP.NET 2005, you can put all the code in the code folders, if you want to. No project file is required.
thisnamesux wrote: There will also be windows applications associated with this project,
Then any common classes should be in dlls.
thisnamesux wrote: Please can the experienced asp.net developers amongst you let me know what you think…
It's hard to say based on whatr you've said. The real questions are:
1 - why did you hire this guy, if you think that you're better than him now, after passing a Microsoft test ?
2 - Why are you talking to us insead of asking him why he's done it this way, or guiding him ( 'we need the core stuff in a dll for reuse, Bob' is better than 'I'm an MCP and you suck, Bob' ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hello all. please i have a project at hand and i need to get it started, need to create an online forum with c# .net. please i need an idea to or help to get started. please fix me up.
need this help please
|
|
|
|
|
try to find some online code search google.
also check www.asp.net.
Naveed Kamboh
|
|
|
|
|
|
|
I am getting this error when i load my page. Seems there is an configuration error of some sort in web.config....can anyone please suggest a solution??
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The container specified in the connection string does not exist.
Source Error:
Line 24:
|
|
|
|
|
Hello All,
I am working in Visual Studio 2003. I want to access local cube (.cub) file with ADODB object. How is this possible?
I am using the following code, but it doesnt seems to work
<br />
Dim cnActive As New ADODB.Connection<br />
Dim rs As ADODB.Recordset<br />
cnActive = New ADODB.Connection<br />
Try<br />
cnActive.Open("provider=msolap;Data Source=c:\temp\mycube.cub;", "", ",0)<br />
rs = cnActive.OpenSchema(ADODB.SchemaEnum.adSchemaCatalogs)<br />
Catch ex As Exception<br />
sError = ex.Message<br />
Exit Sub<br />
End Try<br />
The error is "The operation has failed because of an error in the COM component - unknown error c:\temp\mycube.cub Access Denied. ". I have given full access to this folder but no use. Any ideas?
thanx
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
|
hi ,
If any website developed in asp.net 2.0 whenever we need to make change in code behind (even a bit of change in code ) then again we have need to upload the whole website.
Is there any way to upload only the bin folder (dll) only.
if any please help .
Many many thank in advance..
Regards
Srinandan
|
|
|
|
|
|
I am using ObjectDataSource to display records on a Gridview. In my BLL I have three functions GetAll() [returns MyEntity], Save(MyEntity entity) and Delete(MyEntity entity) which make use of a business entity called MyEntity.
The GetAll() and Save(MyEntity entity) works perfectly fine but the Delete(MyEntity entity) does not work at all. This is what my BLL Delete(MyEntity entity) looks like:
[System.ComponentModel.DataObjectMethod(DataObjectMethodType.Delete,true)]
public Boolean Delete(UserEntity tblUserXref)
{
UserXrefDAL dal = new UserXrefDAL();
return dal.Delete(tblUserXref);
}
And my DAL Delete(MyEntity entity) looks like this:
public Boolean Delete(GlobalClassLibrary.Site.Entities.UserXrefEntity entity)
{
try
{
SqlDatabase dbHelper = new SqlDatabase(ConnectionString.GetConnectionString());
SqlCommand dbCommand = (SqlCommand)dbHelper.GetStoredProcCommand("tblUserXrefD");
dbHelper.AddInParameter(dbCommand, "@XrefId", SqlDbType.Int, entity.XrefId);
dbHelper.ExecuteNonQuery(dbCommand);
return true;
}
catch (Exception)
{
throw;
}
}
Now, when I put a break point I found out that Delete button on GridView does call the BLL's Delete(MyEntity entity) method, but, all the values of my entity are null.
<asp:GridView ID="GridView1"
runat="server"
AllowPaging="True"
DataSourceID="odsUserXrefBLL"
AutoGenerateColumns="False">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"></asp:CommandField>
<asp:BoundField DataField="RemoteId" SortExpression="RemoteId" HeaderText="Id"></asp:BoundField>
<asp:BoundField DataField="XrefId" SortExpression="XrefId" HeaderText="XrefId">
</asp:BoundField><asp:BoundField DataField="UserId" SortExpression="UserId" HeaderText="UserId"></asp:BoundField>
<asp:BoundField DataField="siteUserId" SortExpression="siteUserId" HeaderText="siteUserId"></asp:BoundField>
<asp:BoundField DataField="CreationDate" SortExpression="CreationDate" HeaderText="CreationDate"></asp:BoundField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource
ID="odsUserYardXrefBLL"
runat="server"
UpdateMethod="Save"
DataObjectTypeName="GlobalClassLibrary.Site.Entities.UserXrefEntity"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAll"
DeleteMethod="Delete"
TypeName="GlobalClassLibrary.Site.BLL.UserXrefBLL">
</asp:ObjectDataSource>
Please help. Thanks.
.
|
|
|
|
|
Well you have written a bit complex code but thats your own way.
Are you setting DataKeyNames property of DataGrid? that should be the name of your primarky ke of the table.
Also you need to handle DataRowDeleting event of the Datagrid while you are deleting.
It may help I think if not then excuse me
Naveed Kamboh
|
|
|
|
|
Thanks a lot for your help, DataKeyNames did the trick .
Also on a seperate note: what would you suggesst i should do diffrently to make the code less complex?
|
|
|
|
|
Reallly i dont knonw what to tell you.
May be you are writing v.good.
but i use this simple code which is simple to me .
///
///Delete the record for specified ID
///
/// <param name="catid" />
public void DeleteRecord(Int64 Newsid) {
connection= dbConnect();
string sqlDelete = "Delete from tblTestimonials where Newsid=?Newsid";
MySqlCommand myCommand = new MySqlCommand(sqlDelete, connection);
myCommand.Parameters.Add("?Newsid", Newsid);
int rowsAffected = 0;
try
{
rowsAffected = myCommand.ExecuteNonQuery();
}
finally
{
connection.Close();
connection.Dispose();
}
}
Naveed Kamboh
|
|
|
|
|
I'm having issues sorting a GridView whose datasource is dynammically determined by which report is selected from a drop down. I know sorting is an easy thing if I used a SQLDataSource or an ObjectDataSource and maybe created a table adapter for each report I'm pulling but the idea was to only have to make changes in sql server when new reports are added rather than having to modify any code. Any ideas on how I can sort this dynamically filled GridView? I'm running into an StackOverflowException was unhandled error probably becuase GridView1 doesn't have bound columns or something like that I imagine. When stepping through the code I see e.SortExpression does have the column name in there but it's not working. The RunRptButton_Click event is what the user clicks after selecting the report from a drop down and filling out two text fields for start date and end date (used free daintydate datepicker). And please, if there is a better approach, any help would be great. Here's my code...
<asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle" AutoGenerateColumns="True" AllowSorting="true" OnSorting="Sort_GridView">
</asp:GridView>
protected void RunRptButton_Click(object sender, EventArgs e)
{
try
{
DateTime StartDate = System.Convert.ToDateTime(DaintyDate1.Text);
DateTime EndDate = System.Convert.ToDateTime(DaintyDate2.Text);
SqlCommand cmd = new SqlCommand(RptsDropDownList.SelectedItem.Value, new SqlConnection(
WebConfigurationManager.ConnectionStrings["SID_RequestConnectionString"].ConnectionString));
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("StartDate", StartDate);
cmd.Parameters.AddWithValue("EndDate", EndDate);
//cmd.Parameters.AddWithValue("StartDate", "2006/01/01");
//cmd.Parameters.AddWithValue("EndDate", "2007/01/01");
cmd.Connection.Open();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
cmd.Connection.Close();
cmd.Connection.Dispose();
}
catch (Exception ex)
{
lblErr.Text = "Error: " + ex.Message;
}
}
protected void Sort_GridView(object sender, GridViewSortEventArgs e)
{
try
{
GridView1.Sort(e.SortExpression, SortDirection.Ascending);
}
catch (Exception ex)
{
lblErr.Text = "Error Sorting: " + ex.Message;
}
}
Darren
-- modified at 12:58 Wednesday 28th February, 2007
|
|
|
|
|
I figured out a way to do this with minimal changes by adding a table adapter for each report but if anyone knows a way for me to avoid this, please let me know. No code was necessary for sorting. For those who may want to see this...
I added a table adapter for each report (about 10). In the code below, I have SelectMethod and TypeName hardcoded but that will actually be populated from a table in sql server based on the report they choose from a drop down.
create an ObjectDataSource with just the bare bones
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}">
</asp:ObjectDataSource>
GridView with also minimal config
<asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle" AutoGenerateColumns="True" AllowSorting="true">
<HeaderStyle CssClass="HeaderStyle" />
<AlternatingRowStyle CssClass="AlternatingRowStyle" />
</asp:GridView>
button to run report
<asp:Button ID="RunRptButton" runat="server" Text="View Report" OnClick="RunRptButton_Click" />
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
else
{
// must have this for sorting!
ObjectDataSource1.SelectMethod = "GetRptSIDRevisionCount";
ObjectDataSource1.TypeName = "ReportsBLL";
}
}
protected void RunRptButton_Click(object sender, EventArgs e)
{
try
{
DateTime StartDate = System.Convert.ToDateTime(DaintyDate1.Text);
DateTime EndDate = System.Convert.ToDateTime(DaintyDate2.Text);
ObjectDataSource1.SelectMethod = "GetRptSIDRevisionCount";
ObjectDataSource1.TypeName = "ReportsBLL";
ObjectDataSource1.SelectParameters.Add("StartDate",Convert.ToString(StartDate));
ObjectDataSource1.SelectParameters.Add("EndDate", Convert.ToString(EndDate));
GridView1.DataSourceID = ObjectDataSource1.ID;
GridView1.DataBind();
}
catch (Exception ex)
{
lblErr.Text = "Error: " + ex.Message;
}
}
Now when I add a new report I'll have to add the report info to the table in sql server and unfortunately still have to go in and create a table adapter for the new report. I'd love to not have to do this if anyone knows a better way. Thanks!
|
|
|
|
|
Anyone every hear of any software that tracks users click and records them to a DB or something. We have a decent error trapping process in place but it very hard to try to recreate the error that the user caused. Any thoughts?
|
|
|
|