edotorpedo

Members
  • Content count

    379
  • Joined

  • Last visited

Community Reputation

198 Neutral

About edotorpedo

  • Rank
    Member
  1. [web] Web development manual?

    First of all, I take it that you didn't intentionally triple-post this question. You can request the moderator to remove the other posts if something went wrong. If I have a website template in psd format, I use ImageReady to create a html-layout. If I'm designing my own layout, I first draw my table-layout on paper. I adjust my rough layout by trial & error using css with relative widths and heights. BTW: lifecycle of web development has nothing to do with how you design your pages. You should look into uml / use cases / incremental development / waterfall model. NB: using table-layouts is not considered best-practice, because of the relatively large data-overhead. Edo
  2. Quote: but i dont know the VB code to make a new connection to the database, and call the stored procedure that i have created In your web.config, you have a ConnectionStrings tag: <connectionStrings> <add name="DBConnection" providerName="System.Data.SqlClient" connectionString="Password=PASSWORD;Persist Security Info=True;User ID=sa;Initial Catalog=DATABASE;Data Source=IP-ADDRESS"/> </connectionStrings> And you can access your database using the following code public class ManagerBase { protected string paramPrefix = "@"; private ConnectionStringSettings connectionSettings; public ManagerBase() { connectionSettings = ConfigurationManager.ConnectionStrings["DBConnection"]; } #region Database Specific private DbCommand Command { get { DbProviderFactory factory = DbProviderFactories.GetFactory(connectionSettings.ProviderName); DbConnection connection = factory.CreateConnection(); connection.ConnectionString = connectionSettings.ConnectionString; DbCommand command = connection.CreateCommand(); return command; } } protected DbParameter GetParameter(string name, object value) { DbCommand command = Command; DbParameter parameter = command.CreateParameter(); parameter.ParameterName = name; parameter.Value = value; return parameter; } private DbCommand GetCommand(string query) { DbCommand command = Command; command.CommandText = query; return command; } private DbCommand GetCommand(string query, params DbParameter[] parameters) { DbCommand command = Command; command.CommandText = query; foreach (DbParameter parameter in parameters) { command.Parameters.Add(parameter); } return command; } protected object ExecuteScalar(string query) { DbCommand command = GetCommand(query); command.Connection.Open(); object o = command.ExecuteScalar(); command.Connection.Close(); if (o == DBNull.Value) return null; return o; } protected object ExecuteScalar(string query, params DbParameter[] parameters) { DbCommand command = GetCommand(query, parameters); command.Connection.Open(); object o = command.ExecuteScalar(); command.Connection.Close(); if (o == DBNull.Value) return null; return o; } protected DbDataReader ExecuteReader(string query, params DbParameter[] parameters) { DbCommand command = GetCommand(query, parameters); command.Connection.Open(); DbDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); return reader; } protected int ExecuteNonQuery(string query, params DbParameter[] parameters) { DbCommand command = GetCommand(query, parameters); command.Connection.Open(); int rowsAffected = command.ExecuteNonQuery(); command.Connection.Close(); return rowsAffected; } #endregion I would be a little hesitant of using stored procedures, since you might want to create a database independent businesslogic layer. You also might want to use a datalist and populate it using a Databind(). Asp code: <asp:DataList ID="dlEnquiries" runat="server" RepeatDirection="Vertical" RepeatLayout="Table" BorderStyle="none"> <ItemTemplate> <asp:LinkButton ID="hplEnquires" runat="server" OnCommand="Select_Enquiry" CommandName='<%# Eval("CommandName") %>' CommandArgument='<%# Eval("ID") %>' Text='<%# Eval("Name") %>'></asp:LinkButton> </ItemTemplate> </asp:DataList> And your c# code: public void Select_Enquiry(Object sender, CommandEventArgs e) { // retrieve person by ID and populate other controls } Need a little more info to know what you're exactly trying to achieve and where you got stuck.. Edo
  3. Have you tried using a full path, or does it work when you place the dll in your windows/system32 ? Also: are you calling the dll in an appDomain other than your default appDomain? And it might throw this exception if your dll can not load it's own dependencies (links to other dll's)...
  4. [web] FCKeditor + URL Rewrite

    I think your url-rewrite is breaking your FCK-editor. I've used fckeditor on several occassions and never had any problem with it. That being said, I've never used an url-rewrite. Url-rewriting in asp.net isn't hard, but it isn't easy either. The easiest way to find out if it's the url-rewriting is just to turn it off and see if it works then. Look at http://www.codeproject.com/aspnet/URLRewriter.asp for things you need taken into account.. Edo
  5. [.net] Which IDE Do You Use?

    VS.Net 2005 Pro... with my recently written add-in, which creates a total businesslogic from a database layout. Edo
  6. [.net] ASP.NET automated tasks

    We send our host server administrator a box of chocolates every 3 months :) Get's a lot of things done...
  7. [.net] ASP.NET automated tasks

    It can be done... The easiest way (the way I did facing the same problem) is to have a normal scheduled task in your windows and have it connect to some webpage. This webpage performs a task upon page_load. start -> programs -> accessories -> system tools -> scheduled tasks Example: schedule task "Internet Explorer -http://www.yourwebsite.com/sendemails.aspx", which send emails. Of course this isn't the most secure way, as anyone can access this page. Therefore the best way is to write a small .exe which connects to a webservice with a username-password combo. Of course you have to have access to a server which is online 24/7 and have rights to schedule a task. Normally this server is the same server your web-app resides. Hope this helps, Edo
  8. [web] ASP.NET - Specifying online directories

    This is how I get a path to my access DB: public string DatabasePath { get { return Server.MapPath("~/db/data.mdb"); } } Edo
  9. Tetris AI

    Hi, I already made some replies in a similar topic on Tetris AI: view Tetris AI Topic You might want to read this first...If you have any questions afterwards, I'll be happy to reply.. Edo
  10. I generally use single quotes around server-side property tags with some evalution functions in it. You might want to try it. Like this: Width="80px" DataSource='<%#Eval("Boxes") %>' DataTextField="Text" The other way is to just set it manually in your page_load.... Edo
  11. I've had this problem for a while too... I think the solution was that you have to explicitly set your platform target to 'x86' in stead of default 'any CPU'. Go to Project->Properties...->Build->Platform target. Hope this helps Edo EDIT: AP already posted the solution ;) Good luck
  12. [web] SQL injection test

    No don't filter it, something might get through that you forgot. In stead, use SQL parameters, that's the only way you can not get SQL injection.
  13. Yeah I've also had some trouble using the 'Publish Website' feature. Don't use it, always use xcopy. MS is a strong supporter of the 'xcopy-deployement', so I don't know why they even implemented this feature... Maybe because it only deploys the necessary files and resources: .dll, .aspx, .ascx etc. Edo
  14. You could just use a list and bind it to your datagridview, but I would suggest you use a datalist / datagrid. So List<Employee> employees = EmployeeManager.GetEmployees(); datalist.datasource = employees; datalist.databind(); In your aspx code, you could bind your comboboxes to another List<Teacher> like this: <asp:DataGrid ID="dbOrderList" BorderWidth="0" runat=server ShowFooter="false" ShowHeader="true" CssClass="DownloadList" Width="90%" AutoGenerateColumns="false" > <HeaderStyle CssClass="OrderListHeader" /> <Columns> <asp:BoundColumn HeaderText="ID" Visible="false" DataField="ProductID"></asp:BoundColumn> <asp:TemplateColumn HeaderText="Dozen"> <ItemStyle CssClass="Textbox" /> <ItemTemplate> <asp:TextBox ID="txtNumberBoxes" runat="server" Text='<%# Eval("Quantity") %>' CssClass="SmallTextbox" Width="20px"></asp:TextBox> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn HeaderText="Soort doos"> <ItemStyle CssClass="Textbox" /> <ItemTemplate> <asp:DropDownList ID="ddlBoxes" runat="server" Width="80px" EnableViewState="true" DataSource='<%#Eval("Boxes") %>' DataTextField="Text" DataValueField="Value" CssClass="SmallTextbox"></asp:DropDownList> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn HeaderText="Omschrijving" ItemStyle-CssClass="SmallTextbox"> <ItemTemplate> <%# Eval("Description") %>&nbsp;(<%# Eval("ProductNumber") %>) </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn ItemStyle-Width="10%"> <ItemTemplate> <img id=<%# Eval("ProductID") %> src="./gfx/kruisje.gif" alt="" title="Verwijderen" onmouseover="this.style.cursor='hand'" onclick="RemoveFromCart(this)" /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> BTW: the above is just an example of some code i used for a shopping cart. What exactly do you want to do? Hope this helps, Edo
  15. [web] Side bar menu question

    The easy way: use some third-party (maybe open-source) controls to render them (like the panelbar control on telerik.com). Search for 'panelbar', although I don't think it will be easy to find a good-working free version. The hard way: code it yourself using javascript / ajax. Edo