|
thanks for quick responce,
Actually there is agent master where i need to capture or display agent name,
Services he provides(listbox with multiple select option) and which branch he belongs to corresponding to agentid. Fine . Now One agent can provides any no. of services. so i have provides listbox with multiple select option. i need to save all this information.
my problem is how based on no. of selected listbox data. how can i save the all record. rightnow i saparated this infomation to two table. in one table
i am saving agentid, agentname, branchid, in other table i am saving service no of service. but i am confuged... in
1> how can i retrieve listbox data on save button.especially when there is nultiple records.
2> how can i display it back on edit command and save the changes.
i am using sql2000 along with asp.net and C#
please guide me
thanks
regards
imran khan
|
|
|
|
|
Hai,
Here are the Steps.
1)declare a string strListOptions="";
2)Now Iterate through the ListBoxItems
foreach(ListItem li in lbServices.Items)
{
if(li.Selected)
{
if(strListOptions.length>0)
{
strListOptions+=","+li.Index.ToString();
}
else
{
strListOptions+=li.Index.ToString();
}
}
}
3)Save the Agent Data and Return the AgentID.
4)Save the Services Altogether or individually in the Services Table with the AgentID.
While Retriving:
1)Loop through the records and loop through the list items and select the corresponding indexed listItem.
If you have any problem let me know.
You need to modify the same according to your conditions.
|
|
|
|
|
Hi, somebody know a .Net component able to describe a database using a graph or other browsable data structure thanks to ADO.net ?
I founded Component One DataObjects click here
Thanks !!!
-- modified at 6:22 Monday 8th January, 2007
|
|
|
|
|
Hi every one,
well I'm installing the SQL Server 2005 workgrp edition right now and I had its cd's image u know. well I have run the setup now and there is no sign of "SQL server management studio" in the menu. I selected all the components during the installation and when it scanned the system it showed me a warning that the system requirements are not fulfilled... I must tel u that I'm not upgrading from sql server 2000, its a completely new installation.
how do we know if its a 64 bit version or a 32 bit version.
and plz tell me where am I goin wrong here... is it something I'm missing or what?
well actually I never wanted to use sql 2005 at the first place, I was goin for sql 2000 workgrp ed. but it was not available any where here.
thanks in advance
Rocky
|
|
|
|
|
Can somebody tel me how to create user interface for query builder for select,insert,update,delete statement in asp.net using c#.net
abhijeet
|
|
|
|
|
|
I have a msde server bound to an application.
The application's purpose was to work into a lan, and all went well.
A special user (login) was created for the application use, gratend access to the appication databases, etc.
The problem occured when the database was made public (the computer was connected to the internet and the clients wore not from the lan).
I recive an error message about the inexistence of the server...
So I tried to conenct to the server by the "old way":
osql -S myserver.mydomain.ext -U myUser.
Doing this, the server prompts for a password, and wheater the password is good or wrong I recive the message about the inexistence of the server.
Can anybody help me?
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
How to insert the CheckBox Boolean Values into SQL database using 'SqlDbType.Bit' ...
vidya K.A
|
|
|
|
|
vidya.K.A wrote: How to insert the CheckBox Boolean Values into SQL database using 'SqlDbType.Bit' ...
The same way you'd put in any other Boolean value. However, your request is sufficiently vague to allow several possible correct answers. How do you want to do this? That might help someone fill in the gaps for you.
|
|
|
|
|
Assume spTest as the SQLParameter object and cmdTest as the SQLCommand object:
<br />
spTest = new SqlParameter();<br />
spTest.ParameterName = "@YourTableColumn";<br />
spTest.SqlDbType = SqlDbType.Bit;<br />
spTest.Value = yourCheckBox.Checked;<br />
cmdTest.Parameters.Add(spTest);<br />
cmdTest.ExecuteNonQuery();<br />
SkyWalker
|
|
|
|
|
Hi.
I would like to know how to compare data in different columns but in the same table.(e.g table has two columns one(A and B).I would like to know if i can check if a value in column B exists in column A.
Thanks
Felix
|
|
|
|
|
select b from table x<br />
where exists(select * from table y where x.b = y.a)<br />
Wout Louwers
|
|
|
|
|
Doesnt work.
may work for data in the same row,but for data in different rows this does not work.Thanks anyway
Feleacks
|
|
|
|
|
feleacks wrote: I would like to know how to compare data in different columns but in the same table.
There are two ways (in my knowledge) to do this: 1) Self joining the table. 2) using sub query with EXISTS keyword.
feleacks wrote: I would like to know if i can check if a value in column B exists in column A.
1)
select distinct x.a , y.b from xx x inner join xx y on x.a=y.b --self joining
2)
select b from xx where <code>exists</code> (select * from xx x1 where xx.b=x1.a) --sub query with exists keyword
Here the sub query does not produce any data set, rather it returns True or False . The outer where checks the existence of the rows returned by the sub query. There is a bit difference between the sub query with the exists keyword and other sub queries. Here is an extraction form SQL Server Books Online
>The keyword EXISTS is not preceded by a column name, constant, or other expression.
>The select list of a subquery introduced by EXISTS almost always consists of an asterisk (*). There is no reason to list column names because you are simply testing for the existence of rows that meet the conditions specified in the subquery.
Alternatively, you can also do it as follows:
select b from xx where b = ANY (select a from xx)
-- modified at 3:02 Tuesday 9th January, 2007
The above lines of code are tested with SQL Server 2000
Regards
________________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi All,
plase can anyone tell me the new features(few) of SQL server compared to their versions?
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I never heard of SQL server 2003.
The new features of Sql server 2005 are described here[^]
Wout Louwers
|
|
|
|
|
Rahithi wrote: SQL Server 2003
There is no such product. Were you thinking of Windows Server 2003?
|
|
|
|
|
thanks for the Response. actually right now i am doing my job search. in one of the requirements...
they asked for SQLServer 2003 - stored procedures, dts, sql queries. i really don't know much about this 2003 & 2005 versions. i worked on SQL server 7.0, and also on SQL Server2000.
thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Dear All,
We created a windows application using Sqlserver2000,We have to deploy it at client side. My question is, the client should not be abel to open the database in any way, even if he well known with SqlServer. How do we secure it?
|
|
|
|
|
alav wrote: We created a windows application using Sqlserver2000,We have to deploy it at client side. My question is, the client should not be abel to open the database in any way, even if he well known with SqlServer. How do we secure it?
If you prevent the client from connecting to the database you also prevent the application you deployed on the client from connecting to the database.
There is no such thing as 100% security. If your application can get through then there is a risk that something else can get through also. The solution is to minimise that risk and design the database as if the client has been compromised. Since you are talking about the creation of the windows applicaiton in the past tense I'm guessing it is too late to do much about that. So, what follows are some options you may consider if you were starting again:
* Have the application connect to a specific account on the SQL Server and do not share that information with anyone. Pros: You don't have to give permission to a windows account as the user name and ID are only issued for the one application. Cons: You then have to manage the security of the user name and password which must get installed on the client machine somehow.
* Access the database via a web service. The Web service can then validate all requests to ensure they are acceptable and won't damage the database. The database only needs to give permission to the webservice for access. Pros: A third party arbitrates all requests. Cons: Adds an extra layer that will slow down communication. The web service still has to authenticate the client somehow.
* Stucture your database so no one gets direct access to any of the tables. They must uses stored procedures that validate the input. Pros: The database can go some way to protecting itself. Only a well defined specific set of changes can be made to the database. Cons: Some of the business logic ends up in the database.
|
|
|
|
|
Hi all,
1.can any one please explain me what are this DTS? and why we use this DTS?
2.what is the difference b/w Stored procedure & Function?
3.what are Cursors?
4. what is a join and it's types?
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Rahithi wrote: 1.can any one please explain me what are this DTS? and why we use this DTS?
Data Transformation Services. Supersceded by SSIS (SQL Server Integration Services). It allows you to extract, load and transform data between different databases.
Rahithi wrote: 2.what is the difference b/w Stored procedure & Function?
A function must be deterministic. A stored procedure doesn't have to be.
Stored procedures are more flexible in what you can do within them.
Functions can be used inside a SELECT statement, but stored procedures can't.
e.g.
SELECT * FROM dbo.FunctionName(1, 2, 3)
Rahithi wrote: 3.what are Cursors?
Cursors provide a way to iterate over a result set in a procedural way. They are slow and should be avoided unless you cannot do what is required in a set based operation.
Rahithi wrote: 4. what is a join and it's types?
A join is a way of combining the data in two or more tables into one result set.
For more details see Types of Join[^]
|
|
|
|
|
a google is highly recommended
|
|
|
|
|
Unless you're just asking out of curiosity you'll really need to dig into a good book which addresses each of the topics in detail. Off the top of my head I'd say SQL Server Unleashed would be a good place to start. It should address each and every one of those questions and show you how to use them as well.
|
|
|
|
|
Is there any way to define Optional paramter in SQL server SP.??
CREATE PROC [ EDURE ] procedure_name [ ; number ]
[ { @parameter data_type }
[ VARYING ] [ = default ] [ OUTPUT ]
] [ ,...n ]
[ WITH
{ RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
[ FOR REPLICATION ]
AS sql_statement [ ...n ]
Thanks
Amit
|
|
|
|