reading from two input tables and writing to a third in asp.net using C#
I have two tables that I will search for a user login email adress if its not in the first table, I will checvk the second table, if its not there I would provide an error message. do I need a connection string in web.config for each table?, what is the most efficent way to approach this....Thanks in advanmce
Re: reading from two input tables and writing to a third in asp.net using C#
If the two tables are both in the same DB then no.. you dont need two connection strings...
you just have to check each table for the login..
PSUDO CODE:
Code:
SQLQuery= "select * from table1 where user = " & username
If SQLQuery.count = 0 then
SQLQuery2= "select * from table2 where user = " & username
If SQLQuery2.count = 0 then
MSGBOX "No such user"
ELSE
'Check user cred from table 2
END IF
ELSE
'Check user cred from table 1
END IF
Re: reading from two input tables and writing to a third in asp.net using C#
In order to create a new line into the text file, you can use System.Environment.NewLine or "\r\n", to place a tab space you can use "\t". Reading data from text file and showing on the web page, will not automatically convert \r\n to new line, you will have to replace these characters with the <br /> as shown below.
litText.Text = contents.Replace("\r\n", "<br />");