how to retrieve a single value from datatable
-
that code has been done. just i want to retrieve the single value from the table
What value? What table? You need to provide some more details about your problem.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
What value? What table? You need to provide some more details about your problem.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
winforms sql2008 I have a table Login(id(int),EmailId(varchar(35),connType(varchar)) where conntype has values like pop3 or imap. consider an user is loggedin. i want to fetch connType value of the logged user to do like this if(conntypeValue == imap) { //code for imap connection }else { //code for pop3 connection } how can i do it i want to fetch connType column value from the table login where id = userid
-
winforms sql2008 I have a table Login(id(int),EmailId(varchar(35),connType(varchar)) where conntype has values like pop3 or imap. consider an user is loggedin. i want to fetch connType value of the logged user to do like this if(conntypeValue == imap) { //code for imap connection }else { //code for pop3 connection } how can i do it i want to fetch connType column value from the table login where id = userid
Brilliant! I asked you to explain your problem in more detail and you have just repeated your original question.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Brilliant! I asked you to explain your problem in more detail and you have just repeated your original question.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
I want to connect with pop3 server or imap server on the basis of the account configured by the user. that account values are in the login table. when the user logged in. i want to fetch the value from the login table column servertype. if that value is pop3 the code of pop3 server connectivity will run.
-
winforms sql2008 I have a table
Login(id(int),EmailId(varchar(35),connType(varchar))
where conntype has values like pop3 or imap. consider an user is loggedin. i want to fetch connType value of the logged user to do like this
if(conntypeValue == imap)
{
//code for imap connection
}else
{
//code for pop3 connection
}how can i do it
mschotamaster wrote:
sql2008
I have a tableAight, first you'd need a Sql-statement to select the value you're interested in. Something like this
SELECT [connType]
FROM [Login]
WHERE [Id] = @Idmschotamaster wrote:
i want to fetch connType value of the logged user to do like this
Open a
[SqlConnection](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx "New Window")]
(using a correct connectionstring[^]), create a[SqlCommand](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx "New Window")]
, put the Sql-statement in theCommandText
property, add the parameter, open the connection, and catch the result from theExecuteScalar
[^]-method.Bastard Programmer from Hell :suss:
-
mschotamaster wrote:
sql2008
I have a tableAight, first you'd need a Sql-statement to select the value you're interested in. Something like this
SELECT [connType]
FROM [Login]
WHERE [Id] = @Idmschotamaster wrote:
i want to fetch connType value of the logged user to do like this
Open a
[SqlConnection](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx "New Window")]
(using a correct connectionstring[^]), create a[SqlCommand](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx "New Window")]
, put the Sql-statement in theCommandText
property, add the parameter, open the connection, and catch the result from theExecuteScalar
[^]-method.Bastard Programmer from Hell :suss:
Yes that i want. thanks
-
Yes that i want. thanks
-
Yes that i want. thanks
:confused::confused::confused::confused: if the user is logged in as you say, you must already have read the table to identify him, so you already know how to obtain data from a table.
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
:confused::confused::confused::confused: if the user is logged in as you say, you must already have read the table to identify him, so you already know how to obtain data from a table.
Luc Pattyn [My Articles] Nil Volentibus Arduum
That's what I thought also.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
I want to connect with pop3 server or imap server on the basis of the account configured by the user. that account values are in the login table. when the user logged in. i want to fetch the value from the login table column servertype. if that value is pop3 the code of pop3 server connectivity will run.
Login(id(int),EmailId(varchar(35),connType(varchar)) execute a scalar select connType from Login where id = 5 or select connType from EmailId where id = 'noone@example.com'