|
First create Connection with database and then
Dim databaseRecord As SqlDataAdapter
Dim dstRecord As DataSet
databaseRecord = New SqlDataAdapter("Select * from ", con)
dstRecords = New DataSet
databaseRecord .Fill(dstRecords)
dropdownlistname.DataSource = dstRecords
dropdownlistname.DataTextField = "<table_column_name>"
dropdownlistname.DataValueField = "<table_column_name>"
dropdownlistname.DataBind()
I hope this will workout
ash83
|
|
|
|
|
|
The Calendar Control has a property called SelectedDate. When you post back your first page, store that value from Calendar1 into a session variable. On your second page, you set Calendar2's SelectedDate to the session variable that has the original date.
|
|
|
|
|
Hello Everyone,
Can anybody let me know how set the width of a text box and other controls so that they look similar as they look in Internet Explorer
Actually i set a textbox width : 250 px; and it's being displayed great in Internet Explorer but in Mozilla it's looking just simple and even there is no effect in textbox's width..............................
|
|
|
|
|
Why don't u use CSS.
ash83
|
|
|
|
|
Actually i'm not much familiar to it can u suggest me how to use css
plzzzzzzzzzzzzzzzzzzzzzzzzzzz......
|
|
|
|
|
You should know. After all, you are THE KNOWLEDGE, no?
Search online for CSS stylesheets, you will find plenty of examples
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
try to use properties which are supported by both IE & mozilla
|
|
|
|
|
Hi to all.
I have problem here. I need to get array of directories contained in the directory where my default.aspx is. If I write so:
<br />
DirectoryInfo dir1 = new DirectoryInfo(@".");<br />
I'm getting the "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" directory.
My question is: how can I get the DirectoryInfo of the directory where my default.aspx file is, not pointing to DirectoryInfo constructor the whole path?
|
|
|
|
|
string[] dirs = Directory.GetDirectories(Server.Mappath(""));
Please let me know if it helps.
|
|
|
|
|
Should I include some additional namespace?
|
|
|
|
|
Thank you a lot. It really helped.
|
|
|
|
|
Can anyone teach me how to scroll news or data which is present in SQL Server Database on the web page using asp.net
Thanks in advance.
|
|
|
|
|
Well, the first thing to do is decide on a method to retrieve the data from the database. I would recommend stored procedure for that. Then you should create a data access layer to encapsulate the calls to the stored procedures. Once your retrieve the data, you can show it using a GridView control, a repeater or a DataList depending on your requirements. In a general view, that's all I can think of right now. Check for articles here on codeproject, I'm sure you will find some examples. If not, you will surely find something online. If you have more specific questions, you can post them here to discuss them.
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
gampalabhargav wrote: how to scroll news or data
Do you mean How to display moving/scrolling text in a web page?
Regards John
|
|
|
|
|
gampalabhargav wrote: on the web page using asp.net
ASP.NET can't do anything in scrolling. You can use some javascript or HTML marque to do scrolling. Get details from database and format it with the javascript you are using for scrolling. Set the string to a literal control. You are done.
|
|
|
|
|
|
what wil be the correspomding vb.net code for this:-
if(!Convert.IsDBNull(TxtBxMp .Value)
{
cmd.Parameters("@no_mp_record").Value = CType(TxtBxMp.Text, Int32);
}
|
|
|
|
|
Well, this is not valid code. It's missing a ), and CType is already nasty VB code, C# does not support it ( I just double checked ).
Replace the ! with Not, replace the {} with then and endif, remove the semicolon, and you're probably there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi
First of all C# doesnt support CType
VB code
If Not Convert.IsDBNull(TxtBxMp .Value) Then<br />
cmd.Parameters("@no_mp_record").Value = CType(TxtBxMp.Text, Int32)<br />
End If
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
ya , i also think so. but i had problem which i posted over here in response i got this soln. .
the problem is:
there are textboxes where i am entereing the int type value.here i am using sp to
save the value.if i am giving all the values in the textboxes the its working fine.but if i
am not giving all the values in the textbox means if i left some textbox with giving any value
.then its showing error as:" Message="Conversion from string " to type 'Integer' is not valid.".
where i have written the code as" cmd.Parameters.Add("@no_mp_record", Data.SqlDbType.Int)
cmd.Parameters("@no_mp_record").Value = CType(TxtBxMp.Text, Int32) "
and in the database i have defined its value as null and also in storeprocedure i have done accaordingly.
i have executed the sp seperately n its working.
why i am getting the error. or what will be solution for the error
|
|
|
|
|
TextBox.Text Return String If u pass nothing then it return String.Empty means "" and It can not convert "" to Int.Thats why u r getting this error.
Pass 0 if TextBox.Text=String.Empty Or Pass String Value to SP Instead Of Int.
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
hello biswa,
it is better to go to google and type the conversion code u will get the conversion code.OK
byeee
Murali
Murali
|
|
|
|
|
If Not Convert.IsDBNull(TxtBxMp .Value Then<br />
cmd.Parameters("@no_mp_record").Value = CType(TxtBxMp.Text, Int32)<br />
End If<br />
<br />
'----------------------------------------------------------------<br />
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).<br />
' Developed by: Kamal Patel (http://www.KamalPatel.net) <br />
'----------------------------------------------------------------
Powered by: http://www.kamalpatel.net/ConvertCSharp2VB.aspx[^]
|
|
|
|
|
Hey there.
Check out this cool site....it will convert the code for you.
Ive used it and it works well.
http://labs.developerfusion.co.uk
ciao
Dazz
|
|
|
|