|
Hi All,
Currently I have the following dataset:
Name UserEmailId RoleName RoleID
A A@A.com Admin 1
A A@A.com Dev 2
A A@A.com Tester 3
NOW I WANT THE ABOVE DATASET AS:
Name UserEmailId RoleName1 RollName2 RollName3
A A@A.com Admin Dev Tester
OR
Name UserEmailId RoleID1 RoleID2 RoleID3
A A@A.com 1 2 3
Please provide the solution. Thanks
Rajesh Ram
raj
|
|
|
|
|
rajg82 wrote: Please provide the solution. Thanks
The solution is to properly define your table structures in the first place.
User Table
UserId, Username, Email
Role Table
RoleId, RoleName
UserRole Table
UserId, RoleId
|
|
|
|
|
Hi J4amieC
Yes, I have the same table structure what u mentioned.
thx.
raj
|
|
|
|
|
I think you may be looking for a pivot table clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hey can any one tell me how to read the xml data from sql server....
thanks in advance
icanmakeiteasy
|
|
|
|
|
1) Open a connection
2) Issue a SQL Command using one of the FOR XML commands or read froma n Xml column
3) Close Connection
Further reading[^]
|
|
|
|
|
thanks for reply
i have a xml file at c:\sample.xml
i want to read the sample.xml file from my stored procedure how can i?
icanmakeiteasy
|
|
|
|
|
Based on your posts, use the OPENROWSET[^] function, like:
SELECT * FROM OPENROWSET(BULK 'c:\sample.xml', SINGLE_BLOB) AS somealias
|
|
|
|
|
I AM SAVING DATA OF A EDITOR ON THE BUTTON CLICK. IN TABLE WE HAVE THREE COLUMNS DEPARTMENT DATA , DEPARTMENT ID . AND I AM PICKING DEPARTMENT ID FROM DEPARTMENT SELECTED IN DROPDOWNLIST.. AND I M SHOWING SELECTED DEPARTMENT DATA IN EDITOR. NOW I WANT IF USER EDIT THIS DATA . AND CLICK ON THE BUTTON DATA AGAIN SAVE IN THE TABLE WITH SAME ID IS IT POSSIBLE… GIVE ANY SUGGESION OR QUERY THNX IN ADVANCE.
|
|
|
|
|
Turn your caps off - it is the equivalent of walking up to someones desk and SHOUTING in their ear. It is also really painful to read!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes, its called an UPDATE
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
mu question is on clicking the same button can we add the data with same id . for update we have to use other button.
|
|
|
|
|
why not you create a extra variable which hold the ID of the department. set -1 for new department. If you edit any saved department, then replace -1 to ID of saved department. And finally on button click, check whether variable is equal to -1 then use insert query, otherwise use Update query
|
|
|
|
|
This is a somewhat stupid question, it all depends on your database design - if the id is a primary key then no, otherwise yes.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I'm using IReport and I'm trying to connect to the database on the server from my home computer. It works fine when I connect from my work computer that is on the same network as the server but it fails from home.
I checked on everything, firewall is turned off on the server, all sql server services are running, The tcp/ip port 1433 is enabled and sql server authentication is enabled on sqlexpress.
The url is: jdbc.sqlserver:// serverIpAddress:1433;DatabaseName=mydatabase
It connects from my work pc, but at home it doesn't. Am I missing something?
modified on Thursday, February 26, 2009 2:55 AM
|
|
|
|
|
I think you just committed hari kari, I have not heard of someone attempting this for at least a decade, your exposure is extreme and there are automated systems that test 1433 for open connections.
Having said that you may be lucky and the IP you are using is the local one on your office network and not a publicly accessible IP address. If you want to connect to your office SQL server then do it via web services not directly.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How do I find out which ip address to use in the url??
I'm using windows server 2003
|
|
|
|
|
No idea - as I said a decade since I have seen this done and it has moved on since then.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I now understand that I'm connecting to the ip address that the server and clients have locally which is not necessarily the same as the ip address that the remote database will see..
|
|
|
|
|
how to connect with database when entered select query is correct
|
|
|
|
|
me_aaryan wrote: how to connect with database
use appropriate connection string for connect to database
me_aaryan wrote: when entered select query is correct
select query is used to select the data from database, not for connect to database
Your question is confuse me .
can you post more detail ?
|
|
|
|
|
i mean when the query is right then data should be dispalyed and to display i need to connect
|
|
|
|
|
what is the query and what is the language.
can you provide some code snippet and elaborate how you perform the task?
|
|
|
|
|
You really are an idiot, you have asked the same question 3 times over the last month. You have no understanding of the question you are asking and therefore cannot understand the answers so you keep repeating the question, like a 5 year old.
Remove your self from the forum until you get some more sense.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am having database table as TicketNo,Name,Issue Date. I inserted the data for "IssueDate" field using calender control in Asp.Net.
So the table data looks like this
TicketNo Name IssueDate
1 xxx Feb 5 2009 12:00AM
2 yyy Feb 6 2009 12:00AM
3 zzz Feb 10 2009 12:00AM
4 aaa Feb 15 2009 12:00AM
Now i want to write the query to select "IssueDate" between 02/04/2009 and 02/11/2009.
Please Can anybody help me how to write query to retrieve the data between those dates?
Thanks
Pavani
|
|
|
|