|
I'm trying to implement the sync solution using Microsoft Sync Framework. The server will be SQL server database contains the documents in FileStream and client will be the File system (Windows OS).Do anybody have any idea on this. My application scenario is :The database server contains the File/Documents in the form of byte array by the FileStream mechanism from SQL server. And the Sync activity will syncronize the documents from SQL server to any given file system. Please help me out.
Regards
|
|
|
|
|
I want to send email from my alihusain_77@yahoo.com account to sanabarq2000@gmail.com account. I want to know what I should write in the web.config to handle this using the VB.net coding
|
|
|
|
|
Lots of suggestions here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
set like this:
<system.net >
<mailSettings>
<smtp deliveryMethod="Network" from="someaddress@classifiedspak.com">
<network
host="mail.classifiedspak.com"
userName="someaddress@classifiedspak.com "
password="*************"
port="25" />
</smtp>
</mailSettings>
</system.net>
Comm100 - Leading Live Chat Software Provider
modified 28-May-14 1:46am.
|
|
|
|
|
i want to develop a facility for image album on my website
1 upload photo category wise
2 view photo category wise
|
|
|
|
|
And the issue is?
Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.
Member 7767311 wrote: develop a facility for image album on my website
Develop a website that has possibility of uploading images and view uploaded image. There are numerous articles on the same on web.
|
|
|
|
|
help me int his..,
<script type="text/javascript">
function isCapslock(e) {
e = (e) ? e : window.event;
var charCode = false;
if (e.which) {
charCode = e.which;
} else if (e.keyCode) {
charCode = e.keyCode;
}
var shifton = false;
if (e.shiftKey) {
shifton = e.shiftKey;
} else if (e.modifiers) {
shifton = !!(e.modifiers & 4);
}
if (charCode >= 97 && charCode <= 122 && shifton) {
return true;
}
if (charCode >= 65 && charCode <= 90 && !shifton) {
return true;
}
alert("CpasOn");
//return false;
}
</script>
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="150px" onkeypress="return isCapslock(this)"
></asp:TextBox>
if i press caps lock button nor not it gives me the message Capslock is on...,?
|
|
|
|
|
There's a blog post here ^[^] that claims to detect Caps Lock, but I haven't tried it.
Personally I like this solution[^] which just checks if the character entered is in Caps. If it is, and the ShiftKey is pressed, then Caps Lock is probably on
var s = String.fromCharCode(e.which);
if ( s.toUpperCase() === s && s.toLowerCase() !== s && !e.shiftKey ) {
alert('caps is on');
}
|
|
|
|
|
|
Hello Everybody, I want to develop an asp.net application.
I want to layer it in such a way that the data layer, data access layer and Business Logic Layer are designed in such a way that these layers could be used for any application UI such as silver light, windows apps, WPF ,android apps and ipad apps.
To achieve this I was planning to develop the BL layer using restful services and WCF.
BL layer will be the one interacting with the UI. I have seen lots of debates on this. I feel what I am planning is correct but the application will be huge around 3000 or more web pages and around 1000 table, I want to feel confident I am not going on a wrong track.
Any suggestion and advice will be appreciated.
Regards
|
|
|
|
|
here is my piece of code
alter procedure mdi_anu
(
@entry_date varchar(20),
@updated_date varchar(20),
@status varchar(20),
@cno varchar(20),
@eno varchar(20))
as
declare @SQL varchar(max)
set @SQL='SELECT * FROM anu123 where 1=1 '
if (@status='ALL')
begin
set @status='ALL'
end
if (@status='A')
begin
set @status='A'
end
if (@status='R')
begin
set @status='R'
end
if (@status='D')
begin
set @status='D'
end
if (@status='P')
begin
set @status='P'
end
if (@entry_date<>'' and @updated_date<>'')
begin
set @entry_date =CONVERT (datetime, @entry_date, 103)
set @updated_date= CONVERT(datetime, @updated_date, 103)
set @SQL=@SQL+'and entry_date>=''' +@entry_date+'''and updated_date<='''+@updated_date+''''
end
if (@cno<>'')
begin
set @cno=@cno
set @SQL=@SQL+'and cno=''' +@cno
end
if (@eno<>'')
begin
set @eno=@eno
set @SQL=@SQL+'and eno=''' +@eno
end
exec (@SQL)
End
Can anyone tell me,where am wrong? stuck from 2 hr. Saying incorrect syntax near the last end
|
|
|
|
|
U have to write BEGIN Keyword after As Statement
|
|
|
|
|
Hey i got it. but that's not compulsory i guess.
|
|
|
|
|
alter procedure mdi_anu
(
@entry_date varchar(20),
@updated_date varchar(20),
@status varchar(20),
@cno varchar(20),
@eno varchar(20)
)
as
begin
declare @SQL varchar(max)
set @SQL='SELECT * FROM anu123 where 1=1 '
--if (@status='ALL')
-- begin
-- set @status='ALL'
-- set @SQL=@SQL + 'and status=''' +@status
--end
if (@status='A')
begin
set @status='A'
--set @SQL=@SQL+' and status='''+@status
end
if (@status='R')
begin
set @status='R'
set @SQL=@SQL+' and status=''' +@status
end
if (@status='D')
begin
set @status='D'
set @SQL=@SQL+' and status=''' +@status
end
if (@status='P')
begin
set @status='P'
set @SQL=@SQL+' and status=''' +@status
end
if (@entry_date<>'' and @updated_date<>'')
begin
set @entry_date =CONVERT (datetime, @entry_date, 103)
set @updated_date= CONVERT(datetime, @updated_date, 103)
set @SQL=@SQL+'and entry_date>=''' +@entry_date+'''and updated_date<='''+@updated_date+''''
end
if (@cno<>'')
begin
set @cno=@cno
set @SQL=@SQL+'and cno=''' +@cno+
end
if (@eno<>'')
begin
set @eno=@eno
set @SQL=@SQL+'and eno=''' +@eno+
end
exec (@SQL)
end
the error which m getting is that,suppose m choosing 'D' as my input in the status i get
"Unclosed quotation mark after the character string 'D'.
Incorrect syntax near 'D'."
Whats the problem?
|
|
|
|
|
May be you should append a single quotes after +@status in all your if conditions, if it a varchar field?
|
|
|
|
|
Include a space before and after every string. For example instead of writing 'and eno=''' write ' and eno='' '
Hope it helps. If it does not instead of exec(@SQL) in your SP write print(@SQL) and you will have the complete SQL Query. That will clear the picture to a good deal where the error is.
|
|
|
|
|
Hi,
I have a members website and every memeber will have his images saved ina folder on host.
I wanted to ask what's best way to do it:
/member_id/images
or
/member_guid/images
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: /member_id/images
I would go with Member_Id as that sounds unique and will have a significant value.
|
|
|
|
|
Hi,
if the id will be changed, I suggest to choose the first one, or they are the same.
Comm100 - Leading Live Chat Software Provider
modified 28-May-14 1:46am.
|
|
|
|
|
Hi,
I have been using ExecuteNonReader for a quite long time now and it's doing great for me. For example
SqlCommand cmd = new SqlCommand("select count(uname) from users_tbl where uname=@uname and password=@password", con);
cmd.Parameters.AddWithValue("uname", username);
cmd.Parameters.AddWithValue("password", password);
con.Open();
cmd.ExecuteNonReader();
then why should I use it like this:
SqlCommand cmd = new SqlCommand("select count(uname) from users_tbl where uname=@uname and password=@password", con);
cmd.Parameters.AddWithValue("uname", username);
cmd.Parameters.AddWithValue("password", password);
con.Open();
cmd.ExecuteScalar();
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: ExecuteNonReader
I don't find a knowledge base article for the same in MSDN. Based on what I know and can infer, using it to get just a 'single' value will be an overhead. It should be used when database query is going to provide a set of records.
My guess, term in discussion is ExecuteNonQuery and should not be ExecuteNonReader .
Jassim Rahma wrote: ExecuteScalar
Executes the query, and returns the first column of the first row in the result set returned by the query.
Refer: Refer: SqlCommand.ExecuteScalar Method [^]
Now, based on the details and documentation, for getting a count, ExecuteScalar fits in the best that will get me the result directly as needed.
|
|
|
|
|
Hi,
ExecuteNonReader: used actions like insert, update, delete
ExecuteScalar: will return an object
for details you can learn from some books about these two.
Thanks,
CommDev
modified 6-Dec-16 1:27am.
|
|
|
|
|
Hi,
ExecuteReader
Do not use: when database query is going to provide for sure exactly 1 record. It may be getting record by its id (which is PK in the database) - GetOrderById and such. In this case use ExecuteNonQuery with output parameters.
Use: when database query is going to provide a set of records. It may be search or report.
ExecuteNonQuery
Use: when we are talking about a single database record - in Update, Insert, Delete and Get by Id. In all these cases we can use input/output/input-output parameters. Please note that from the application architecture point of view it is also good practices when your Insert and Update stored procedure returns changed record exactly like Get By Id method does.
ExecuteScalar
Do not use: when database query returns a single value and this value can be defined as parameter in T-SQL. ExecuteNonQuery with output parameter(s) is always preferred in this case since it is more flexible, tomorrow there will be 2 values therefore having ExecuteNonQuery we do not need to change method signatures.
Use: when database query returns a single value and this value cannot be defined as output parameter, because of T-SQL type limitation for variables. For example type image cannot be output parameter in MSSQL.
The most common example for ExecuteScalar is fetching a single image stored in the database and converting it to array of bytes. If you google it - most examples will demonstrate using of ExecuteReader to accomplish image handler, however ExecuteScalar will be more scalable and faster.
Conclusion
Always use ExecuteNonQuery except: when you have a set of records - use ExecuteReader and when you have a single output value that cannot be defined as a parameter - use ExecuteScalar. Hope this helped to clarify something. Enjoy
Comm100 - Leading Live Chat Software Provider
|
|
|
|
|
Thanks CommDev.
But if I am going to return GetOrderById.. what's the difference if I am going to use ExecuteNonQuery with Output parameter or ExecuteReader with return SqldataReader?
Does it make a difference specially performance wise?
Technology News @ www.JassimRahma.com
|
|
|
|
|
hi,
Generally we use execute scalar function for displaying the first column and first row, but if we use ExecuteNonReader it will show error why because in asp.net only 3 commands are there ExecuteReader()
ExecuteNonQuery()
ExecuteScalar() this is the option to get one value from the database.
|
|
|
|