|
Hi all
this is my first posting in this forum.
i am struck in a problem in asp.net 2.0.
i am using master file and a css file for my default page.
now i want the user change the css file attributes of the master file in the run time.
my question is that how can i do that?
if any one has an answer please let me know this.
thanks to all.
SP
sp
-- modified at 2:06 Monday 20th March, 2006
|
|
|
|
|
This thread should be in the ASP.NET section...
As for your question: could you provide more information. Becouse I really don't see what is the point of doing this...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have a slight problem and wondering if someone else has encountered this.
Host platform: Windows 2000 Server, SP4
- MySQL Server 5.0.18 was running perfectly.
- Added MSSQL 2000 to 2K Server and now MySQL is getting a signal to exit.
It is desirable to run both on my server, and access either one as needed. I am thinking someone must have ran into this before and know of any compatibility issues.
Thanks for your help!
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
I am guessing here, but maybe you should check the ports they are using...
Make shure they use different ports...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
CWIZO wrote: I am guessing here, but maybe you should check the ports they are using...
Make shure they use different ports...
Yes, check and make sure they are not the same. By default, MySQL is port 3306 and MSSQL 2000 is like 1433 (not 100% on this but close).
PJC
|
|
|
|
|
Yep, MySQL uses 3306, and MSSQL uses 1433 and 1434 I hear. I'll try reinstalling MySql at the expense of hosing MSSQL, lol Stay tuned.
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
Hi,
Im a newb to MS SQL so some help would be appreciated. I need to detect duplicated records in a DB by their email. Ive got the following code which works fine for displaying the email adress and the number of occurences -
sSQL = "SELECT *, COUNT(email) AS NumOccurrences FROM Contacts WHERE AccountHolderID = " & makeSQL(session("SAT_USERID")) & "GROUP BY email HAVING ( COUNT(email) > 1 )"
However i need to be able to display data associated with the email such as the username and firstname of each occurrance. So ultimately i need to display all records where the email adress of that record is also present in another record. Then display all the data associated with those records. I also need to group the matching emails together.
Im sure this must be possible, so your help would be rather good!
Thanks!!!!
|
|
|
|
|
You could consider current your SQL staterment as a View, then you create another SQL staterment that joint with above view on Email field. Hope that could work
-- modified at 5:36 Monday 20th March, 2006
|
|
|
|
|
Hi,
Im not sure what you mean. Could you give me an example?
Thanks!
|
|
|
|
|
SELECT a.*, b.* FROM Contacts AS a, (SELECT Email, COUNT(Email) AS NumOccurrences FROM Contacts GROUP BY Email HAVING NumOccurrences > 1) AS b WHERE a.Email=b.Email
Also, I dont really understand what you mean. So hope that work
|
|
|
|
|
nguyenvhn,
I tried the code you gave me and got the following error:
Microsoft OLE DB Provider for SQL Server error '80040e14' <br />
<br />
Invalid column name 'NumOccurrences'. <br />
Ok let me explain....
I have a table which holds members contact / address book. I need to determine if they have duplicate entries for the same email in their contacts. So for example:
Dave, Smith, Dave@mywebsite.com
and
D, Smith, Dave@mywebsite.com
would be considered duplicate entries because they both have the same email address. Because each member has often several thousand contacts, their maybe 4 or 5 copies of a contact.
So i need to be able to display all these duplicate contacts on screen, and grouped together so that for example all the
Dave@mywebsite.com 's are all grouped to gether on screen and all other duplicates are on screen eg:
D, Smith, Dave@mywebsite.com
Dave, Smith, Dave@mywebsite.com
Dve, Smith, Dave@mywebsite.com
Paul, Wills, Paul@wills.com
P, W, Paul@wills.com
etc etc.
Hope this makes it clearer?
So what would be the code i need for this?
Thanks for the help so far!!!!!
|
|
|
|
|
I have created a table (named Contacts) with 3 columns and folowing data:
Email FirstName LastName
-------------------- -------------------- --------------------
Dave@mywebsite.com D Smith
Dave@mywebsite.com Dave Smith
Dave@mywebsite.com Dve Smith
Paul@wills.com Paul Wills
Paul@wills.com P W
vu.nguyen@erasvn.com V N
(6 row(s) affected)
Here is my SQL statement:
SELECT a.*, b.NumEmail FROM Contacts AS a, (SELECT Email, COUNT(Email) AS NumEmail FROM Contacts GROUP BY Email HAVING COUNT(Email)>1) AS b WHERE a.Email=b.Email ORDER By a.Email
And below is the result:
Email FirstName LastName NumEmail
-------------------- -------------------- -------------------- -----------
Dave@mywebsite.com D Smith 3
Dave@mywebsite.com Dave Smith 3
Dave@mywebsite.com Dve Smith 3
Paul@wills.com Paul Wills 2
Paul@wills.com P W 2
(5 row(s) affected)
Is that your needed?
|
|
|
|
|
Hi nguyenvhn,
Thats excellent mate! Thanks so much for the help.
However i realise now that i forgot to mention that i need to perform the above statement in relation to specific users contacts.
In other words i need to show the results only working from a specific users own address book. So how do i make it search by the AccountHolderID ?
I tried this:
SELECT a.*, b.NumEmail FROM Contacts AS a, (SELECT Email, COUNT(Email) AS NumEmail FROM Contacts GROUP BY Email HAVING COUNT(Email)>1) AS b WHERE a.Email=b.Email AND a.AccountHolderID = '2 & accountID & "' ORDER By a.Email
But the data it returned did not match up prorperly. For example it would show a contact just once but say it had 6 matches. So it appears that it was probably doing the email match count on ALL records in the db but then only showing those registered to the current user????
HOpe you understand what i mean!!!
So i obviously need to place:
a.AccountHolderID =
somewhere else in the statement? I dont know...so if you could help me out id be even more greatful than i am now!
Thanks again!!!!
-- modified at 6:36 Wednesday 22nd March, 2006
I think i got it:
SELECT a.*, b.NumEmail FROM Contacts AS a, (SELECT Email, COUNT(Email) AS NumEmail FROM Contacts WHERE AccountHolderID = " & makeSQL(session("SAT_USERID")) & " GROUP BY Email HAVING COUNT(Email)>1) AS b WHERE a.Email=b.Email AND AccountHolderID = " & makeSQL(session("SAT_USERID")) & " ORDER By a.Email
This seems to work as i expected. If their is a more efficient way, then let me know. If not, thanks for your help!!!!
|
|
|
|
|
Hello Members,
I am facing problem in updating the dataset (Database). I have tried number of things(all may b wrong). Can u please help me. This is the code
Dim bm As BindingManagerBase<br />
Dim currentrow As Integer<br />
Dim ds As New DataSet()<br />
Dim bval As Boolean<br />
Dim dt As DataTable<br />
Dim dr As DataRow<br />
Dim cn As SqlConnection = New SqlClient.SqlConnection("Data Source = ; Database = Pubs;uid=sa")<br />
Dim da As SqlDataAdapter = New SqlClient.SqlDataAdapter("Select * from publishers", cn)<br />
Dim flag As Integer<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
da.Fill(ds, "publishers")<br />
bm = Me.BindingContext(ds.Tables("Publishers"))<br />
bm.Position = 0<br />
Loaddataincontrols()<br />
Setbuttons(True)<br />
LockTbox()<br />
End Sub<br />
<br />
Public Sub Loaddataincontrols()<br />
TextBox1.Text = ds.Tables("Publishers").Rows(bm.Position)("Pub_id").ToString<br />
TextBox2.Text = ds.Tables("Publishers").Rows(bm.Position)("Pub_name").ToString<br />
TextBox3.Text = ds.Tables("Publishers").Rows(bm.Position)("city").ToString<br />
TextBox4.Text = ds.Tables("publishers").Rows(bm.Position)("State").ToString<br />
TextBox5.Text = ds.Tables("Publishers").Rows(bm.Position)("Country").ToString<br />
End Sub<br />
<br />
Private Sub CmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdAdd.Click<br />
'dr = (ds.Tables("Publishers").NewRow)<br />
Setbuttons(False)<br />
UnLockTbox()<br />
ClearControls()<br />
flag = 1<br />
'LoaddatainDataset()<br />
'ds.Tables("Publishers").Rows.Add(dr)<br />
End Sub<br />
Public Sub UnLockTbox()<br />
TextBox1.ReadOnly = False<br />
TextBox2.ReadOnly = False<br />
TextBox3.ReadOnly = False<br />
TextBox4.ReadOnly = False<br />
TextBox5.ReadOnly = False<br />
End Sub<br />
Public Sub ClearControls()<br />
TextBox1.Text = ""<br />
TextBox2.Text = ""<br />
TextBox3.Text = ""<br />
TextBox4.Text = ""<br />
TextBox5.Text = ""<br />
End Sub<br />
Public Sub LoaddatainDataset()<br />
dr("Pub_id") = TextBox1.Text<br />
dr("Pub_name") = TextBox2.Text<br />
dr("City") = TextBox3.Text<br />
dr("State") = TextBox4.Text<br />
dr("Country") = TextBox5.Text<br />
End Sub<br />
<br />
Private Sub CmdModify_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdModify.Click<br />
UnLockTbox()<br />
flag = 3<br />
Setbuttons(False)<br />
' dr = ds.Tables("Publishers").Rows(bm.Position)<br />
' dr.BeginEdit()<br />
' LoaddatainDataset()<br />
' dr.EndEdit()<br />
'Setbuttons(False)<br />
'da.Update(ds, "Publishers")<br />
'da.Fill(ds)<br />
'bm.Position = 0<br />
End Sub<br />
<br />
Private Sub cmdRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRemove.Click<br />
' dr = ds.Tables("Publishers").Rows(bm.Position)<br />
' ds.Tables("Publishers").Rows.Remove(dr)<br />
dt = ds.Tables("Publishers")<br />
dr = dt.Rows.Find(TextBox1.Text)<br />
flag = 2<br />
End Sub<br />
<br />
Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click<br />
Dim da As SqlDataAdapter = New SqlClient.SqlDataAdapter("Select * from publishers", cn)<br />
If flag = 1 Then<br />
dt = ds.Tables("Publishers")<br />
dr = dt.NewRow()<br />
LoaddatainDataset()<br />
dt.Rows.Add(dr)<br />
ElseIf flag = 2 Then<br />
dr.Delete()<br />
ElseIf flag = 3 Then<br />
dt = ds.Tables("Publishers")<br />
dr = dt.Rows.Find(TextBox1.Text)<br />
dr.BeginEdit()<br />
LoaddatainDataset()<br />
dr.EndEdit()<br />
End If<br />
flag = 0<br />
CreateCommandAndUpdate("Data Source = ; Database = Pubs;uid=sa", "Select * from Publishers")<br />
da.Fill(ds)<br />
<br />
<br />
' LoaddatainDataset()<br />
' da.Update(ds, "Publishers")<br />
' da.Fill(ds)<br />
bm.Position = 0<br />
Loaddataincontrols()<br />
Setbuttons(True)<br />
End Sub<br />
<br />
Public Function CreateCommandAndUpdate( _<br />
ByVal connectionString As String, _<br />
ByVal queryString As String) As DataSet<br />
da.SelectCommand = New SqlCommand(queryString, cn)<br />
<br />
Dim commandBuilder As SqlCommandBuilder = _<br />
New SqlCommandBuilder(da)<br />
<br />
<br />
<br />
' Code to modify the data in the DataSet here. <br />
<br />
' Without the OleDbCommandBuilder this line would fail.<br />
da.Update(ds)<br />
da.Fill(ds)<br />
'End Using<br />
CreateCommandAndUpdate = ds<br />
End Function
It gave me these errors
An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll
Additional information: Update requires a valid InsertCommand when passed DataRow collection with new rows.
An unhandled exception of type 'System.Data.MissingPrimaryKeyException' occurred in system.data.dll
Additional information: Table doesn't have a primary key.
Please Help....
Regards,
Amit
|
|
|
|
|
Hello Everybody,
I was searching net on data concurrency, when I came across this Article, where the user says we can use a webservice and create a component which can send a message to the user informing him that the message he is trying to edit is already in use by other user and i personally belive tht after the editing is completed by user1, user2 should again get a message stating that the user1 has completed editing record, you can now edit the record.... is it possible.. if yes then how???? can someone give me the code for it.
http://weblogs.asp.net/fbouma/archive/2003/05/24/7499.aspx[^]
I am pasting the last para of the article for your kind reference
So, every time you write code to pop up a window to notify the user he can't save his work because another user has already modified the rows he tries to overwrite, ask yourself this: "wouldn't it be better to notify the user before he started working on that rows?".
Thanking you and waiting for some kind replies.
Amit
|
|
|
|
|
Hi to all,
please help me i am finding commands to Backup and restore sql database which i will select , from my .Net project directly.
anant
-- modified at 3:03 Sunday 19th March, 2006
|
|
|
|
|
Hi, the only SQL Command I know is this one:
The SELECT INTO Statement
The SELECT INTO statement is most often used to create backup copies of tables or for archiving records.
Syntax
SELECT column_name(s) INTO newtable [IN externaldatabase]
FROM source
Check the w3school website for complete documentation:
http://www.w3schools.com/sql/sql_select_into.asp
With Kind Regards
|
|
|
|
|
backup database database_name to disk='path'
Beemen Beshara
-- modified at 10:50 Sunday 19th March, 2006
|
|
|
|
|
hi Beemen,
Thanks for helping me, But you didn't give the restore command.
I tried the Backup command and it worked, COOL man .
My the faculties never teach me these kinds commands.
THANKs
anant
|
|
|
|
|
Hi Amit,
You should you DataSet for First,Back,Next,Last.
How to use?
1. Use DataAdapter to Fill DataSet and then it will be easy. But make a Separate Function like RecordJumper(Num as internet) as Integer.
where num is to Move record Up/Down.
2. Like wise for Last ---------- RecordJumper(0),
for back ---------- RecordJumper(i-1)
for next ---------- RecordJumper(i+1)
for last ---------- RecordJumper(record.RecordCount -1)
And use DataAdapter with DataSet to Add,Remove,Modify,Update.
Note: Use select commands for Add,Remove,Modify,Update.
I think this will help you.
anant
|
|
|
|
|
Hi,
Is there a command to only get row 450-500 out of a 1000 row result?
nixter
|
|
|
|
|
i think there is no direct way for that. But you can use subtract query. And if you get any direct way then also tell me.
|
|
|
|
|
Excuse my lack of knowlege here, I am primarily a MySql user. Importing data in MySQL is a piece of cake in through mysql.exe using the following syntax:
<br />
LOAD DATA LOCAL INFILE 'filename.csv'<br />
INTO TABLE myTable<br />
FIELDS TERMINATED BY ','<br />
LINES TERMINATED BY '\n';<br />
But I now have to switch over to SQL Server. Is there an equivalent SQL Conversational interface like mysql.exe through which I can enter SQL commands?
If not, what is the recommended method for importing files?
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
There are several interfaces to enter SQL commands for SQL Server: Query Analyzer (a GUI application), isql.exe and osql.exe , plus sqlcmd.exe in SQL Server 2005.
For performing a bulk file import, you would normally use either bcp.exe (stands for Bulk CoPy) or the BULK INSERT statement.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
You need the MS SQL server enterprise manager there you will find a tool just to import and export data for just about anything.
Hear,See,Learn,Understand,Practice <hslup>
Many can be good,but only ONE can be the best keep practicing
|
|
|
|
|