|
The problem is it thinks that the integer column is a text column. could you give an example of how catalogXml.table[0] is populated ??
|
|
|
|
|
Thanks for your response.
I do a databind and bind the dataview to the datagrid.
DataView.Sort() with a sort expression doesn't seem to work right.
Is there a value i should be passing for sort expression to indicate the integer column?
|
|
|
|
|
no the sort is working fine but the problem is that it is sorting on string and not integer values. You can try changing the data type of the dataColumn something like -
myTable.Columns[columnName].DataType = System.Type.GetType("int32");
This might throw an error (but its worth a try) something like - cannot change the type of a column that has already been filled with data.
|
|
|
|
|
catalogXml.Tables[0].Columns["Price"].DataType = System.Type.GetType("int32");
catalogXml.ReadXml( path );
if( !catalogXml.HasErrors )
{
DataView dvCatalog = new DataView(catalogXml.Tables[0]);
lblSortExpression.Text = e.SortExpression;
dvCatalog.Sort = e.SortExpression;
dgProductList.DataSource = dvCatalog;
dgProductList.DataBind();
}
I can't change the data type after there is data in it and cannot access myTable before loading the data!
this somehow does not seem to work
|
|
|
|
|
have a look at the following link -
http://www.dotnet247.com/247reference/msgs/56/283683.aspx
Same problem as yours.
|
|
|
|
|
Thanks, it was a great pointer.
One needs to declare a Dataset and datatable.
Add columns to table and specify the data type for the columns
and then load the data set with any value.
Really appreiciate your help.
|
|
|
|
|
Hi All,
I am working on a .Net library to be used within the organization. There are lot of configuration settings for the library. Now the question is whether i put all the configuration in the web.config file and access using the configsectionhandler interface or should i put the configuration in a seperate xml file and access using XML DOM.
One of the reason i asking this bcos if we change anything in the web.config file the whole application resets which i donot want.
Can anyone please tell me which one is a better approach and why ????
Thanxs in advance.
Maharishi Bhatia
|
|
|
|
|
My personal view on this is "neither". Rather structure your library's methods and constructors so that they accept the settings as parameters. Then, it is up to the caller application to either hard-code the values or deal with the config file issue.
This approach also makes for easier unit testing your library, because your tests can easily deal with several different testing scenarios.
my blog
|
|
|
|
|
Hi Steven,
Thanxs for the prompt answer. Let me rephrase my question...
I have already made the library with librarys method and constructors that accept the settings as parameter. I am trying to make a wrapper class which will read from a settings file so that the developer doesnt have to write any code to pass setting data to the library. So actually i was looking for a solution whether to put the config settings in the web.config file or to put it in a seperate xml file. And which solution will be better...
Thanxs in advance.
Maharishi Bhatia
Nothing is Impossible. Even impossible spells "i m possible"
|
|
|
|
|
Like you say, web.config is not always the best choice, although it is certainly the easiest.
Some options:
* Use a generalized config API, like Nini
* Use an external config file
* Use your own home grown config solution
my blog
|
|
|
|
|
i made uploading tool using freeaspupload component and i customized it to store the uploaded files to a DB using ADO, i had the webserver (IIS) and the sqlserver 2000 on the same machine and it was working fine ,no problems at all , but when i moved the DB to the production server (the webserver and the DB on separate machines) the upload failed , it started to give me a syntax error msg:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'file'
(file is the field i use to store my files to) i tried to use appendChunk but still the same error
|
|
|
|
|
below is what i have apparently it is not supported on windows server 2003:
Public Sub SendEmail(ToWho, Subj, Mess)
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
With objMail
.MailFormat = CDOMailFormatMime
.To = ToWho
.From = Application("Support_Email")
.Subject = Subj
.Body = Mess
.Send
End With
Set objMail = Nothing
End Sub
My software developer said i should replace it with:
Public Sub SendEmail(ToWho, Subj, Mess)
Dim objMail
Set objMail = Server.CreateObject("CDO.Message")
With objMail
'objMail.MailFormat = CDOMailFormatMime
objMail.To = ToWho
objMail.From = Application("Support_Email")
objMail.Subject = Subj
objMail.HTMLBody = Mess
objMail.Send()
End With
Set objMail = Nothing
End Sub
But it doesnt work either any help is appreceiated
thanks
Just learning
|
|
|
|
|
hi ,
i want to create an ASP.Net forum using c# if anyone have done this before he can tell me how to start , i think i will start now with the login and registration forms but if there is better idea i will be great to know
thanks and waiting for reply
Eng.Nashwa
|
|
|
|
|
|
Start with creating a scheme for your database.
Which tables you need, which fields ...
Creating your webapp from there seems easy enough... I think .
Modifying your Dbase afterwards will take you right into trouble.
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi,
I have an XML file, which contains several nodes like the ones below:
<saml:Attribute AttributeName="ssbAssertionVersion" AttributeNamespace="http://www.syntegra.com">
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">1.0</saml:AttributeValue>
</saml:Attribute>
- <saml:Attribute AttributeName="cn" AttributeNamespace="http://www.syntegra.com">
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">Doe Joanna B</saml:AttributeValue>
</saml:Attribute>
----> My objective is to , take the value present inside the tag, "saml:AttributeValue " and populate it in my custom grid control, which will accept the element name as a parameter and display its value.
Problems:
1. ELEMENT NAME IS THE SAME IN ALL THE NODES, "saml:AttributeValue".
2.I dont want to reframe a new xml file out of this present one, since it increases the processing time.
3.I cant give an xpath query, directly to the my custom grid control.it will accept only the element name of a xml file.
Please help me, if you can think of a logic, that has to finally make the 'saml:AttributeValue' element name unique,without reforming a new xml so that i can directly feed that into my grid control.
Thanks In advance,
Regs, Manivannan
|
|
|
|
|
OK ALL,
Developer from the Uk, with all this "Accessibility" stuff going on I need a TRUE CSS drop down menu.
Every day I learn something new! Most of all how much I don't know. xx
|
|
|
|
|
Does anyone has adress where I can see some pictures on how web services work (especially useful whould be with mobile devices)...
tnx in advance
|
|
|
|
|
I have a problem. I receive this error:
Database error: Invalid SQL: select b.id as category, a.id as link, a.*, 1*(a.showt-a.showc)+ #total search 1*(a.showc) + #total in category 3*(a.hit) as criteria2 from links a right join link_categories b where (category,link,criteria2) in ( select b.id as category, a.id as link, 1*(a.showt-a.showc)+ #total search 1*(a.showc) + #total in category 3*(a.hit) as criteria from links a right join link_categories b on b.id=a.category_id where To_Days(Now()) - TO_Days(a.ldate) > 7 order by criteria asc limit 0, 5) order by criteria2 desc;
MySQL Error: 1064 (You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'where (category,link,criteria2) in ( select b.id as categ)
The SQL statement is:
select b.id as category, a.id as link, a.*,
1*(a.showt-a.showc)+ #total search
1*(a.showc) + #total in category
3*(a.hit)
as criteria2
from links a right join link_categories b
where (category,link,criteria2) in (
select b.id as category, a.id as link,
1*(a.showt-a.showc)+ #total search
1*(a.showc) + #total in category
3*(a.hit)
as criteria
from links a right join link_categories b
on b.id=a.category_id
where To_Days(Now()) - TO_Days(a.ldate) > 7
order by criteria asc
limit 0, 5)
order by criteria2 desc;
Where might be the problem?
You might be a killer and you even don`t know it.
|
|
|
|
|
HI, its possible to save images from urls without doing right-click-save images as..? I need to save images with a procedure that i get it the url of image.
Anyone know if is this posible?
Thanks for all
|
|
|
|
|
I guess u need to save / download image, when u know its url using some procedure.
If this the case u can use WebClient.DownloadFile (simple), or use HttpWebRequest and HttpWebResponse.
cool man
|
|
|
|
|
How can i get asp.net to valid to xhtml 1.1? I keep getting errors on this line:
I assumed it was from the view state, and i set all the view states on my page(hammackj.com) to false and it still appears...any way around this?
|
|
|
|
|
Hi,
It is a bit difficult, because Asp.Net 1.1 doesn't support strict xhtml, but you can look at this article http://www.codeproject.com/aspnet/ASPNET2XHTML.asp[^].
But IMHO it is not that important to have valid pages now (better working, than valid ) because .Net 2 (=Visual Studio 2005 = Whidbey) will support strict xhtml pages (I'm really looking forward to this new version!).
|
|
|
|
|
Thanks so much =) I modified it to work for 1.1 will hold me over till 2005 =)
|
|
|
|
|
I am trying to make a script using JavaScript to display images like Windows Picture Viewer.
This is what I have so far:
Gallery Beta 1[^]
I am having problems with my script online however. It seems to work fine locally, from what I can tell. The problem is I have the image loaded when a picture is clicked, however nothing happens the first time you click it, so you have to click it a second time for the image to be displayed properly. I've been looking through my code to see what I can do to fix it, but for the time being I am stumped. Here is my Java script:
window.onload = init;<br />
window.onresize = getSize;<br />
<br />
var preview;<br />
var path;<br />
var extension;<br />
var previewImage = new Object;<br />
var actualWidth;<br />
var actualHeight;<br />
var thumbnails;<br />
var imageContainer;<br />
var windowX;<br />
var windowY;<br />
var tempWidth;<br />
var tempHeight;<br />
<br />
function init()<br />
{<br />
if (document.getElementById)<br />
{<br />
thumbnails = document.getElementById('thumbnails').getElementsByTagName('IMG');<br />
preview = document.getElementById('previewimage');<br />
imageContainer = document.getElementById('imagecontainer');<br />
}<br />
else if (document.all)<br />
{ <br />
thumbnails = document.all['thumbnails'].all.tags('IMG');<br />
preview = document.all['previewimage'];<br />
imageContainer = document.all['imagecontainer'];<br />
}<br />
else window.alert('Please update to a more current browser');<br />
<br />
previewImage = new Image;<br />
previewImage.src = preview.src; <br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
getSize(); <br />
<br />
click();<br />
}<br />
<br />
function getSize()<br />
{<br />
<br />
tempWidth = actualWidth;<br />
tempHeight = actualHeight; <br />
<br />
preview.style.width = tempWidth;<br />
preview.style.height = tempHeight;<br />
<br />
resizeContainer();<br />
<br />
windowSize();<br />
<br />
checkSize();<br />
}<br />
<br />
function resizeContainer()<br />
{<br />
imageContainer.style.width = actualWidth;<br />
imageContainer.style.height = actualHeight;<br />
tempWidth = (actualWidth / 2) * -1;<br />
tempHeight = (actualHeight / 2 + 75) * -1;<br />
imageContainer.style.marginLeft = tempWidth
imageContainer.style.marginTop = tempHeight
}<br />
<br />
function windowSize()<br />
{<br />
<br />
<br />
if( typeof( window.innerWidth ) == 'number' ) <br />
{<br />
windowX = window.innerWidth;<br />
windowY = window.innerHeight;<br />
}<br />
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )<br />
{<br />
windowX = document.documentElement.clientWidth;<br />
windowY = document.documentElement.clientHeight;<br />
} <br />
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) <br />
{<br />
windowX = document.body.clientWidth;<br />
windowY = document.body.clientHeight;<br />
}<br />
windowY -= 150;<br />
}<br />
<br />
function checkSize()<br />
{<br />
<br />
<br />
if ((previewImage.width <= windowX) && (previewImage.height <= windowY))<br />
{<br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
tempWidth = actualWidth;<br />
tempHeight = actualHeight; <br />
<br />
preview.style.width = tempWidth;<br />
preview.style.height = tempHeight;<br />
}<br />
else if ((preview.width < windowX) && (preview.height < windowY))
{<br />
if (preview.width > preview.height)<br />
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
getSize();<br />
}<br />
else<br />
{<br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height;<br />
getSize();<br />
}<br />
}<br />
else if ((preview.width <= 125) || (preview.height <= 125))<br />
{<br />
return 0;<br />
}<br />
else if ((preview.width > windowX) && (preview.height > windowY))
{<br />
if (preview.width > preview.height)<br />
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
}<br />
else<br />
{ <br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height; <br />
}<br />
getSize();<br />
}<br />
else if (preview.width > windowX)
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
getSize();<br />
}<br />
else if (preview.height > windowY)
{<br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height;<br />
getSize();<br />
}<br />
<br />
}<br />
<br />
function click()<br />
{<br />
<br />
for (var i=0;i<thumbnails.length;i++)<br />
{<br />
thumbnails[i].path = thumbnails[i].src.substring(0,thumbnails[i].src.lastIndexOf('/') + 1);<br />
thumbnails[i].extension = thumbnails[i].src.substring(thumbnails[i].src.lastIndexOf('.'));<br />
thumbnails[i].onclick = clicked;<br />
}<br />
}<br />
<br />
function clicked()<br />
{<br />
<br />
var fullpath = this.path+this.id+this.extension;<br />
previewImage = new Image;<br />
previewImage.src = fullpath;<br />
<br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
preview.src = fullpath;<br />
<br />
getSize();<br />
<br />
<br />
<br />
<br />
}
I have a few TODO's. One being I need to clean up my code, second I need to add more comments.
This is my Style Sheet (note that some styles are used on other pages):
<br />
body.splash<br />
{<br />
margin: 0;<br />
background-color: #555555;<br />
color: #EEEEEE<br />
}<br />
<br />
body.gallery<br />
{<br />
margin:0;<br />
background-color: #DDDDDD;<br />
height: 100%;<br />
width:100%;<br />
}<br />
<br />
div.container<br />
{<br />
height="100%"<br />
}<br />
<br />
html.gallery<br />
{<br />
overflow: hidden;<br />
}<br />
<br />
div.preview<br />
{<br />
background-color: #DDDDDD;<br />
width: 100%;<br />
height: 100%;<br />
}<br />
<br />
div.filmstrip<br />
{<br />
position: absolute;<br />
background-color: #DDDDDD;<br />
height: 150px;<br />
width: 100%;<br />
bottom: 0;<br />
overflow: hidden;<br />
overflow-y: hide;<br />
overflow-x: scroll;<br />
white-space: nowrap;<br />
}<br />
<br />
span.thumbnails<br />
{<br />
position:absolute;<br />
height: 125px;<br />
width: 100%;<br />
text-align:center;<br />
}<br />
<br />
.thumbnail<br />
{<br />
padding-left: 5px;<br />
padding-right: 5px;<br />
vertical-align: middle;<br />
}<br />
<br />
.imagecontainer<br />
{<br />
position:absolute;<br />
top:50%;<br />
left:50%;<br />
height:796px;<br />
width:800px;<br />
margin-top:-473px; <br />
margin-left:-400px;<br />
background-color:#DDDDDD;<br />
}<br />
<br />
.previewimage<br />
{<br />
height: 796px;<br />
width: 800px;<br />
overflow:hidden;<br />
}<br />
<br />
.center<br />
{<br />
}<br />
<br />
.middle<br />
{<br />
position:absolute;<br />
top:50%;<br />
left:0;<br />
height:230;<br />
width:100%;<br />
margin-top:-115px; <br />
background-color:#EEEEEE;<br />
text-align:center;<br />
}<br />
<br />
.below<br />
{<br />
font-family:arial;<br />
font-size:12px;<br />
margin:0;<br />
padding:0;<br />
height:auto;<br />
background-color:#555555;<br />
}
The HTML source you can view here:
Gallery Beta 1[^]
Please do not comment on my ugly code, I already know , but if you would like to help me clean it up, feel free !
Thanks in advance!
-Sef
|
|
|
|