f1 fan 16 Posting Whiz in Training

Hi,

i have done the same steps & my application is also running well on the Windows 2003 server..

Except for the user who receives a hyperlink from the application in their mailbox to perform a set of operation the hyperlink received by them is pointing towards the old server from which i transferred the whole application...

Example::

Received by the user: http://old_server/application/filename.aspx/Dynamic...

Sent through the application & should be
http://new_server/application/filename.aspx/Dynamic...

Any help would be highly appreciated on this...

The message in your email has the wrong base address in it. Without knowing how and where you send the email from I cannot help too much. But to send a link via an email you have to put in the full url for the user to click. Whereever you generate that url is what the problem is, you forgot to change the code to send the new server url.

f1 fan 16 Posting Whiz in Training

yes you can pass an array such as
MyMethod(byte[] jpgstream)
{
}

parameters are passed by value as a default so no need to specify byval. If you want to pass by reference then specify ref before EACH parameter that you want as a reference. There is also the OUT keyword in C# to specify out parameters (by val is and In parameter, by ref is an IN/OUT parameter and OUT is an Out parameter).

f1 fan 16 Posting Whiz in Training

I personally put them in seperate assembly for testing and not compile the assembly for deployment.

f1 fan 16 Posting Whiz in Training

It seems you have copied (or used) a VS 2003 application in VS2005. There were some subtle changes when VS2005 was introduced which included Partial Classes.

Previously when creating a windows form in VS2003 you had 2 files created - the designer and the code file (plus resx but we will leave that as it didnt change). When you dropped a component on the VS2003 it added all the code to create that component in the InitialiseComponent() method in the cs code file. There used to be a region which was called "Windows Generated Code - Do not edit" where this was all done. But people used to mess in there and have their forms broken. So in VS2005 MS broke it out into a 3rd form (the designer file) and used Partial Classes (a partial class allows you to define a class in multiple files - which makes following your code much easier and I recommend you break all your classes down in this way).

You have copied the VS2003 c# code (myform.cs) (including the initialisecomponent() code) in your VS2005 c# code (myform.cs) and you already have a file (myform.designer.cs) with that in it. So the errors are because you have 2 InitialiseComponent methods (Which you are allowed - thats called overriding) but they have the same signature (ie same parameters - none in this case) which is not allowed in overriding.
The second error is the same as there …

f1 fan 16 Posting Whiz in Training

You have all your logic in a big tangled mess.

I suggest you start by writing in pseudo code what you want to do and then code. You have while loops that do nothing, while loops inside for loops inside while loops and call the same method inside all those loops. A recipe for disaster.

You can simplify this greatly.

f1 fan 16 Posting Whiz in Training

For real simplicity just add a string to the items collection with dashes in it "-------" or underscores "________"

Not nice but simple.

Otherwise you will need to use the GDI tools and the graphics object of the listbox at run time and override the onpaint event.

f1 fan 16 Posting Whiz in Training

The microsoft grid cannot do that. I use the infragistics grids for mulitple related tables.

For read only you could use the datarepeater and use the child rows under each main row in their own repeater.

For true "grid" function you need something like the infragistics grid. They are in a suite which is costly but well worth it with all the other tools you get too. The grid comes with excel like filters, summaries and mult column sort on header click. The combos and drop downs are multi column too and can display so much.

I should get a commission lol :)

f1 fan 16 Posting Whiz in Training

90% of what you do in C# (or any OO language for that matter) is in functions.

I am not sure exactly what you are asking though - I know you are new to C#. You ask if you can put some repetative code in a function and call it over and over instead of coding it everytime. But coding it every time is writing a function every time and calling that code is calling a function - so it is the same principal in c#.

If you could be a little bit clearer or give some small code of what you are trying to do I will give you a better answer to get you on your way. :)

f1 fan 16 Posting Whiz in Training

Could be anywhere

Without code and which IE is giving you the problem we cant help

f1 fan 16 Posting Whiz in Training

It is the data not your code. You are putting something in there that cant be converted at runtime. Probably a null value somewhere - you have no testing of the data before you manipulate it.

f1 fan 16 Posting Whiz in Training

In a word - State

Remember asp.net is stateless. When you click the button click the page reloads first and so you lose the previously added column.

You need to turn on their viewstate

f1 fan 16 Posting Whiz in Training

The best way then is to go to a host that offers everything and copy your website there. Add the extras for the comments form and then on the old site get them to do url redirecting to the new site. This means anyone typing the old address will be automatically sent to the new one so you dont lose visitors

f1 fan 16 Posting Whiz in Training

I++

We use existing license software. Everything has to have a license. There are no automatic free trials. Free trials give people ways to abuse it, hack it or your competitors a chance to see what you have for free.

If someone wants a free trial of our software I will generate a one time one use license key for them to use - that gives me full control and cannot be abused (well everything can be abused or hacked at some point in time but this gives us much tighter control)

f1 fan 16 Posting Whiz in Training

We use both depending on the app. I have SQL for web apps, we also code for company sql databases and we use SQL express for some small desktop apps but mainly use SQL express so our users can work offline and then it will sync back to a main SQL Database when they are connected to the net

f1 fan 16 Posting Whiz in Training

I forgot to mention that Northwind is not the best for SQL 2005 - they brought out adventureworks to show it off - you can get that at
http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en

f1 fan 16 Posting Whiz in Training

no they have it - it just isnt shipped anymore with it as not everyone wants it on their system.

They have it for download with other samples at
http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en

f1 fan 16 Posting Whiz in Training

Assuming you have fully tested it (and that means using qualified testers (more than 1) and automated tools) then you could use some online places firstly such as CNET downloads, windows marketplace, component source, digital river etc. to sell it for you.

What about licensing? How will you stop people making copies?

f1 fan 16 Posting Whiz in Training

Hey guys

Dont reinvent the wheel :) the guys at Microsoft have developed a central data access layer and other useful stuff. It is in their applications blocks in Patterns and Practices and there are many useful blocks in there to use. All of them are proven and very useful in enterprise applications

http://msdn2.microsoft.com/en-us/practices/bb190359.aspx is where to find them all :)

f1 fan 16 Posting Whiz in Training

the arguments are an array so you add the whole argument into the array.

eg. p1.arguments.insert("loginname=Admin",0);
p1.arguments.insert("loginpassword=true",1);

f1 fan 16 Posting Whiz in Training

without going into too much argument over html vs asp.net controls etc (and I also use asp.net controls sparingly) I think you all missed the point of the original question :) haha

I took it as he wanted to know how to open a new window not the button click event. So in answer to the original question - to open a link in a new browser window you need to set "target=_blank". That is if you are using an anchor (or hyperlink if you insist on them - but i strongly suggest you try an html anchor and some css). Otherwise use the window functions in javascript if you are going that way.
:)

f1 fan 16 Posting Whiz in Training

use the javascript timer function and set its interval to be the time entered.

using your example
setTimeout("alert('Some Message!')",5400000);


the 5400000 is the number of milliseconds before the function fires. 1 hr and 30 minutes = 90 minutes = 5400 seconds = 5400000 milliseconds.

f1 fan 16 Posting Whiz in Training

Be careful you dont write your vb6 code on the intranet as you will see big performance losses. You not only have to port it to a web based application but also to .net and asp.net (along with ajax, javascript etc.) all of which will help performance if you use best practices.

File size wont really be too much of an issue when it comes to an intranet application - data will be the bigger problem. Your choice of data objects (business objects, ado.net datasets, the new linq objects (well worth using if you have .net3) xml etc) will all play a vital role.

Without going into too much detail you can look at image sizes (give thumbnails or small images and a way to look at a large image if they want to). Image resolution is a biggie too. A screen is no better than 90dpi so dont have hi res images that are at 300 dpi for printing. Create different sizes of the same image for each place you use them. This will give the smaller file size then.

Data input validation should be done on the client, and then checked on the server, the rest of the logic should all be on the server.

Use Ajax where you can as this will give a more desktop look to your application and also allow you to do a lot more server round trips without page refreshes.

Use pages in …

Fungus1487 commented: a great help +1
f1 fan 16 Posting Whiz in Training

I assume this is some homework?

It can be done using a grid or table. You can then react to cell events if you wish. To save it in a database you have to run through each cell (ie every column in every row) one at a time and save the contents of that cell into a datarow (noting the column number and row number so you can bring them back later on if needed).

Going beyond this basic "spreadsheet" will get too complex for you and unless it is homework I would go and get a free web based spreadsheet out there.

f1 fan 16 Posting Whiz in Training

Thats why microsoft give you a built in database (northwind) so you dont have to get one to start off.

f1 fan 16 Posting Whiz in Training

Firstly you need to install SQL Server Express on the web server as it may not be installed. Then you need to copy your database to the correct place (as it says the database is not there). then you need to configure SQL Server Express to allow user instances. Then you must ensure you have the correct permissions on the database and the correct connection string in your application.

f1 fan 16 Posting Whiz in Training

To use a remote SQL Server you need to add the settings to your web config. At the top you need to add the connection string

<connectionStrings>
		<add name="MyConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=[I]servername[/I];Initial Catalog=[I]database[/I];UID=[I]username[/I];pwd=[I]password[/I]"/>
	</connectionStrings>

Then you need to change authentication mode to forms and add the providers.

<authentication mode="Forms">
			<forms name="[I]appname[/I]" loginUrl="login.aspx" protection="All" path="/" timeout="60"/>
		</authentication>
		<membership defaultProvider="MySqlLoginProvider">
			<providers>
				<add name="MySqlLoginProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MyConnectionString" applicationName="[I]appname[/I]" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" passwordAttemptWindow="30" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/>
			</providers>
		</membership>
		<roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPRoles" cookiePath="/" cookieTimeout="60" cookieSlidingExpiration="true" cookieProtection="All">
			<providers>
				<add name="MyRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="MyConnectionString" applicationName="[I]appname[/I]"/>
			</providers>
		</roleManager>

Now when you go to the admin site you will see the new providers and test them :)

f1 fan 16 Posting Whiz in Training

that is extremely dangerous for a number of reasons. Firstly does the end user know you are taking their files? What is to stop you taking other files such as their password etc.
Secondly how do you know they arent malicious and put a virus or something in its place and infect your server?
The file upload is the best way so at least the user knows what is going on.
If you need a file sent (such as a log file etc) then usually the best way is to attach it to an email and send it to support that way.

f1 fan 16 Posting Whiz in Training

single row = executereader
single value = excutescalar. This will return the first column of the first row only so will not be any use for a single row that has more than one column.

f1 fan 16 Posting Whiz in Training

no easy way sorry.
You have to get an array of datarows where the surveyid = the surveyid of the row you deleted (140 in your example) and sorted on the question number column. Then run through each one and redo the question number using a count
e.g.

DataRow[] rows = QuestionTable.Select("SurveyID = " + deletedrow["surveyid"], "QuestionNum asc");
for (int i=0; i < rows.length; i++)
{
  rows[i]["QuestionNum"] = i+1;
}
f1 fan 16 Posting Whiz in Training

use a string builder if you want to make it yourself.

stringbuilder sb = new stringbuilder;
sb.appendline("<table>");
for (int i=0; i<=arraycount; i+=2) //for vb people it is For I = 0 to arraycount Step 2)
{
sb.appendline("<tr>");
sb.append("<td>");
sb.append(arrayvar[i]);
sb.appendline("</td>");
sb.append("<td>");
sb.append(arrayvar[i+1]);
sb.appendline("</td>");
sb.appendline("</tr>");
}
sb.appendline("</table>");
//now put it on the page - probably using a literal
literal1.text = sb.tostring();

or you could use an html writer but this works just as well.

f1 fan 16 Posting Whiz in Training

you need the very simple String.Split() method.
your string will be the textbox.text field and the delimiter will be a space. This returns an array of strings.
This is C# but VB is 95% identical

//I did this the long way for you to follow
char[] delimiter = new char[1] {' '}; //thats your space
string[] words = string.split(textbox.text, delimiter);
// you now have an array of words.
f1 fan 16 Posting Whiz in Training

We need more information... post the line or two of code that throws the error.

f1 fan 16 Posting Whiz in Training

ahhhhhhh the oldest mistake with webpages that everyone forgets about.

This is web pages NOT windows forms so you have to remember the difference it is VITAL!

See your event handler at the top?

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

It fires every time the page is loaded. This is NOT the same as a windows form page load event which fires once. Every postback also has to reload a web page and hence the page load event fires and your code fills the textbox again from the database. THEN it fires the click event and saves the old data back.

So the way around it is to only run your code when it is a fresh load and not a postback. How do you know when this is? Ask the Page. you need to wrap your code with an If NOT IsPostback ... End If wrapper.

Lots of people miss it and think of windows forms not web pages.

Also be aware of the opposite - sometimes you need to fire some code on every page load including postbacks so make sure you put that outside of the if end if block. I have seen them spend hours looking for the problem - myself included :)

f1 fan 16 Posting Whiz in Training

I dont know Visual Web Developer but if you are using .net 2 framework then everything is built in for you. Use the membership class. Even if you dont use it and roll your own you should have one table for logins and passwords and then the users have roles (one is lecturer and one is student) so get the roles for the user.
This is the same for membership class. it is very straightforward to use if you read up on it. VS2005 has controls to use too so you need 1 line of html to login a user.

f1 fan 16 Posting Whiz in Training

you would have to write javascript so that on each keypress you would check the script against the array and return the next item in the array.

If you wanted to do it server side you can do the same against a larger array using ajax. AFAIK MS Ajax 1.0 has an autocomplete extender for a text box out of the box.

f1 fan 16 Posting Whiz in Training

in your html code you need

<input type="button" value="Print" onclick="javascript:window.print();" />

f1 fan 16 Posting Whiz in Training

my mistake for not concentrating while writing the post

try

.tablecellhyperlinks td

f1 fan 16 Posting Whiz in Training

if you have bound the datagrid to the datasource and have insert, update and delete commands in your data source just set allowedit and allowdelete = true for the gridview and it will take care of it all for you. You need something seperate to add and i use the detailsview with defaultmode set to insert and bound to the same datasource.
If you want more control over the gridview when edititng etc change each bound field into a template field and then change the item, edititem and any other templates you want.

f1 fan 16 Posting Whiz in Training

do you have a mail server on your local machine? you are calling the smtp server on localhost but i suspect the service isnt installed and running. use a known smtp server. then add .net credentials to the smtpmail.

I would also use the system.net.mail namespace rather than the old smtp namespace if you have .net 2 on your pc

f1 fan 16 Posting Whiz in Training

document.all doesnt work in all browsers as far as i know. use the more robust document.getElementById("myRTF")

That doesnt always work either especially with older browsers.

f1 fan 16 Posting Whiz in Training

my vb and my VS2003 are very rusty so there may be a better way than this.

You just get the record from the dataset/datatable and set the textbox.text or label.text = to the rows cell for the relevent data.

eg dim arow as datarow
textbox1.text = arow("firstname")
label1.text = arow("DOB")
etc and do the reverse to update the data.

You could always set the databinding on a text box and label and then put the textbox and labels datasource to the row and call databind on it too but i am rusty with VS2003 to know whether it is available in that or just 2005.

f1 fan 16 Posting Whiz in Training

It doesnt by default for a website in VS2005. you would just upload your aspx files to your webserver.

You can get it to compile to a dll and upload the dll if you want. It is more secure on the webserver but harder to maintain.

I usually keep my aspx files as they are (and the cs code behind files) on the webserver to make it easier to change. Most of the web stuff gets served up to the user anyway and they can view the source. It wouldnt take much to be able to work out your code. Also if they can get into your server to steal your aspx files then they can steal your dll, reverse engineer it in seconds and make any changes and upload it so it isnt any more secure.
We keep all our other more secure code in normal dlls and either host them on the same server or call them through other means which makes the code more secure and also the dlls themselves.
If you just want your site to run then you dont have to compile it to a dll just upload it to a webserver.

f1 fan 16 Posting Whiz in Training

dont you use the built in memebership providers? all the information is done for you. When a user is logged in and you need to know their information at any time just call Membership.GetUser() and it will return the current logged in user who made the request. It caches it too if you call it more than once in the page. Then you can use the profile provider too.
Much more powerful and easier to use than roll your own

f1 fan 16 Posting Whiz in Training

Atlas was microsofts name for Ajax.net when it was in beta. At the last minute (RTM 1.0 is out now) they changed it to ajax.net
There is a great sample website with ajax.net control toolkit with a webpage for all the controls and source code for each page plus documentation in the webpages for each tool :)

f1 fan 16 Posting Whiz in Training

in answer the original question your page references were incorrect. you have to get a reference to the calling page from the Server.Request object. Cast that to a Page object then findcontrol for your tabs. This is better than javascript as it is all done on the server. There are plenty of articles on how to get the calling page.
The alternative is to use session objects etc as mentioned above. The best way is to pass the information in as a query so when you redirect from one page to the other grab the labels value and pass it to the next page in the request eg www.yoursite.com/newpage?labelvalue='the value you just grabbed'
This will guarantee the value will get there (no relying on cookies being turned on etc) and easy to get at the other end

f1 fan 16 Posting Whiz in Training

the error is in your dbmig dll. The reason you see the error is you dont have debugging on that dll (probably because you have just the dll and not the source code there).

In the code in the dll you are trying to connect to the database but your syntax is incorrect and you are incorrectly using the "provider" keyword (or something you setup is trying to use it incorrectly).

Check your dll source code for that method. Have you tested it?

f1 fan 16 Posting Whiz in Training

The easiest way is to write a query to select the data from all 3 tables and put them into a dataset with relationships.
Then you just have to iterate through the first table one row at a time and create a node for it. Then run through that rows child rows one at a time and create a node for them and add them to the parent node, and run through each of the child rows of those rows and do the same.
In pseudo code (as i am more a C# than Vb person)

..Create Dataset with 3 tables and 2 relationships
Create a top node
For each table1row in table1
Create table1node
Add it to topnode's node
for each table2row in table1row.getchildrows()
Create table2node
Add it to table1node
for each table3row in table2row.getchildrows()
Create table3node
end table3row for each
end table2row foreach
end table1row foreach
f1 fan 16 Posting Whiz in Training

Ok i will try again.
In SQL Server there is a system database called Master. This is the heart of SQL Server. Whenever you add an object to SQL Server such as a database, a user, a stored proc, a table, a column etc. it is put into the master database. Go look at the master database tables and you will see all your databases in there.
So alll you have to do is write a query to select all from the table in the master database where the object type is a database. e.g. select * from dbo.master.the_table_with_the_databasenames where the_type = the_database_type.
That is as close as i will go but it is just that one line. I could give you the select query but you will learn a lot more about SQL Server if you figure it out yourself.

f1 fan 16 Posting Whiz in Training

If you want to see some of the AJAX power then go the http://www.cloisonneheirlooms.com and look at the homepage there. It is a new wholesale site i am building for a customer and only the front page is ready.
The animation is done with about 5 lines of ajax.net code and the whole thing is done with divs and css with the odd script thrown in.

f1 fan 16 Posting Whiz in Training

OK
You can get webdeveloper express which is free and makes it a lot easier.
the code below has a grid view which lets me list, edit and delete items in the grid (it could select too but i have no need of that in this example).
grid views dont allow news rows so i use a details view (below it) which is in default mode of insert.
Both are bound to the sqldatasource which you see below them. In my case i have the connection string elsewhere in my app which it knows to go find by the <%$ ... %> tags. You can use stored procs etc but i included this code for you to see
Hope it helps you

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
        AutoGenerateColumns="False" DataKeyNames="aID" DataSourceID="SqlDataSource1" Caption="Collections" Width="300px">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="aID" HeaderText="aID" ReadOnly="True" SortExpression="aID" Visible="False" />
            <asp:BoundField DataField="CollectionName" HeaderText="Collection Name" SortExpression="CollectionName" />
        </Columns>
    </asp:GridView><br /><br />
    <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
        DataKeyNames="aID" DataSourceID="SqlDataSource1" DefaultMode="Insert" Height="50px"
        Width="300px" Caption="Add New Collection">
        <Fields>
            <asp:BoundField DataField="aID" HeaderText="aID" ReadOnly="True" SortExpression="aID" Visible="False" />
            <asp:BoundField DataField="CollectionName" HeaderText="Collection Name" SortExpression="CollectionName" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:CHComConnectionString %>" DeleteCommand="DELETE FROM [Collections] WHERE [aID] = @original_aID AND [CollectionName] = @original_CollectionName"
        InsertCommand="INSERT INTO [Collections] ([aID], [CollectionName]) VALUES (newid(), @CollectionName)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [aID], [CollectionName] FROM [Collections] order by [CollectionName]"
        UpdateCommand="UPDATE [Collections] SET [CollectionName] = @CollectionName WHERE [aID] = @original_aID AND [CollectionName] = @original_CollectionName">
        <DeleteParameters>
            <asp:Parameter Name="original_aID" Type="Object" />
            <asp:Parameter Name="original_CollectionName" Type="String" /> …