|
Hi
I'm in need of some code segment to create a .cab file in my application. I got one CabLib.dll from one link provided by codeproject itself. But it worked weel in local machine.But it doesn't work in server after uploading. (I read in some article that we can use System.Web.Util class. But it doesn't support the cab creation now.
Could anyone please help me to locate some dll's or built in class in .net to solve this problem?
Nicejith
|
|
|
|
|
There is a system provided utility makecab.exe (present in c:\windows\system32 folder) which you can invoke with relevant parameters to generate the cab file from your C# application. You can start the process using System.Diagnostic.Process object and use Start method to start the process for using in your code.
Let me know if you need any more help in this regard.
|
|
|
|
|
Hi Guys,
I am using a coding for the number of hits in a web application.I have used the database to store the number of hits.My problem is I am able to update the hits in the database.But the variables which I have used in Session is unable to store the value and retrieve it when the page loads.
Please give your sugesstion
Thanks
|
|
|
|
|
Dear jithbiz0033,
If you want to implement something like that I think
1.you must use application variables not a session variables.
2.And you have to write code in Application_OnBeginRequest() event handler in global.asax file. So any updation of your application variable must be done inside Application_OnBeginRequest() functiion.
3.While updating inside Application_OnBeginRequest() , you can use Lock property also in case you want to get out of concurrentcy problem.
Hope these helps you,
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi Arindam
I used Application variables as per ur suggestion.I am able to retreive the value in the local system.But I am not able to retrieve the variable value live in the web page.
Thanks
jith
|
|
|
|
|
See if you are getting that value in local there is no reason why it wount work in live server. Please tell me whether you are getting any error or the value is not updated.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi,
The value is getting updated and I am not getting any error in the live server.I am able to retrieve the number of hits by using a separate database connection and not through the Application["Counter"].
Thanks
jith
|
|
|
|
|
Hi Guys,
I have a problem with the screen resolution.I have a default screen size of 1024 X 768 in my web application. I have given this size in a table column within which all the other controls are placed.But the screen size changes when it redirects to other pages.I have used query string to get the value of contents that has to be loaded on the page.
Please give your suggestions
Thanks
|
|
|
|
|
Dear jithbiz0033,
1. Why dont you use percent for your LAYOUT tables ...
2. Or else ..
a)You must have different stylesheet classes pre-defined for your applications and add all stylesheet FILES in your application.
b)Then using some javascript you have to catch screen resolution and apply defferent stylesheet class dynamically to your HTML control.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi,
I am not able to get my desired resolution.Any other options available.How to catch screen resolution using Javascript?
Thanks,
jith
|
|
|
|
|
You can get screen resolution by
alert('Your resolution is :width :'+screen.width+' Height'+screen.height);
Get the current screen resolution and instruct your application to use a specific css file.
As an example: If you have a css file names sample1024.css that can be used once you detect the screen resolution is 1024.
Hope it will be helpfull to you.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi Arindam,
Thanks. For the response.I sorted out my error using dreamweaver.The error was in the script tag.I closed the script using.But it preferred the type
<script lang=" " src=" "> .
Thanks
Jith
|
|
|
|
|
Dear jithbiz0033,
Thanks,
Arindam D Tewary
|
|
|
|
|
hi all,
I am workingin a windows where i need to insert data into the Db using ODBC connection.I used stored procedure to insert data.
here is the code
EventType,Eventdate,vehicle I declared correctly and getting correct values also
System.Data.Odbc.OdbcCommand Emp = new System.Data.Odbc.OdbcCommand("DBO.INSRTEVNT", mycon);<br />
addEmp.CommandType = CommandType.StoredProcedure;<br />
<br />
<br />
Emp.Parameters.Add("@EventType", System.Data.Odbc.OdbcType.Int).Value = EventType;<br />
Emp.Parameters.Add("@EventTime",System.Data.Odbc.OdbcType.DateTime).Value <br />
= EventDateTime;<br />
Emp.Parameters.Add("@Vehi", System.Data.Odbc.OdbcType.VarChar).Value = Vehicle;<br />
<br />
Emp.ExecuteNonQuery();
but when i execute the code,the data are not inserting and throwing exception.
here it is
ExceptionSystem.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function 'DBO.INSRTEVNT' expects parameter '@EventType', which was not supplied.
but I passed correct data only..
Plz give me suggestions to resolve the problem.
Thanks in advance.
cheers
sangeet
|
|
|
|
|
Try this code if ur getting that 3 value in textbox like this otherwise based on ur input change the id name...,
Dim strInsertproc As String
strInsertproc = "INSRTEVNT'" & txteventype.text & "','" & txteventtime.Text & "','" & txtvehi.text & "'"
sqlcmd = New SqlCommand(strInsertproc, sqlconn)
sqlcmd.Connection.Open()
sqlcmd.ExecuteNonQuery()
sqlcmd.Connection.Close()
sqlcmd.Dispose()
lblMsg.Text = "Record Inserted............"
Magesh
|
|
|
|
|
hi try to add parameters in the following way
Emp.Parameters.Add(New System.Data.Odbc.OdbcParameter("@EventType", System.Data.Odbc.OdbcType.Int));
Emp.Parameters("@EventType").Value = EventType;
Emp.Parameters.Add(New System.Data.Odbc.OdbcParameter("@EventTime",System.Data.Odbc.OdbcType.DateTime));
Emp.Parameters("@EventTime").Value = EventDateTime;
Emp.Parameters.Add(New System.Data.Odbc.OdbcParameter("@Vehi", System.Data.Odbc.OdbcType.VarChar, 100));
Emp.Parameters("@Vehi").Value = Vehicle;
Emp.ExecuteNonQuery();
|
|
|
|
|
thanks for ur reply ..
i tired the code.
but still am getting the same error.
ExceptionSystem.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function 'INSRTEVNT' expects parameter '@EventType', which was not supplied.
plz give me suggestions
cheers
sangeet
|
|
|
|
|
I am using a text box within the update panel - context
But, I am not being able to validate it using the regularexpression validator.
any Ideas ?
Thank you
|
|
|
|
|
Hello There again i guess, can you help me w/ this.i look for some example of validating a username and password in a
database on the internet..well looking for some tutorial instead,i found one and copy it, i follow the instruction, but i
dont get it..maybe im a slowlearner,there are instrcution that i dont get it..
here are the instructions
Pre-Code Setup:
1. Create a New ASP.NET Web Application. I called mine NorthLogin2
2. Rename the default aspx Webform to Login or Index or something more descriptive. I called mine Login2.aspx
3. Assuming you are in Visual Studio.Net right click on this form in the Solution Explorer and Select Set as Start Page.
4. Find your Northwind.mdb file (The classic Northwind Database in Access)
Under Tools, Options, Tables/Queries Tab select Run Permissions as Owner's
5. Create a new table for login requirements. I called mine tblUser
Columns U_id (autonumber), U_Name (text), and U_Password (text with Input Mask of Password)
6. Create Query (i.e. Stored Procedure) to validate login(s). I called mine sp_ValidateUser
In the SQL Designview the code for that query is
SELECT COUNT(*) AS Num_of_User
FROM tblUser
WHERE (((tblUser.U_Name)=[@UserName]) AND ((tblUser.U_Password)=[@Password]));
This query counts the number of users that it retrieves which matches the where clause. The @UserName and @Password are the
values passed in to the query from the Webform.
7. Close database, because you can not access it while it is open.
-----------END
--->in the ff. instruction i already done the instruction # 1-5..im confused about #6..would you help me with that..coz
there are no instruction, i dont know how to put COUNT* on the query at MS ACcess,i tried to create in a "Create Query in
Design View" but where should i found COUNT(*)??im not that expert in MS Access and SQL..
-->what does API mean?.
-->well theres another one...along with the tutorial is said that "This is sample code for a ASP.Net Login page (using Visual
Basic.Net code behind) with OleDB connection to an Access Database using ADO.Net."..it means whenevr you bulid or creating
asp.net with database access does it means that im also creating a Access database at ADO.net??
-->ok here is another one(sorry if im going to ask all the confusing question inside my head)..im also want to create a
"Forum" web application that i will include in our website project...our team leader(only at our project)also my classm8 said
that i have to used a "control panel" to done it..i dont know what she means??would someone give me an idea what "Control
Panel" is or a hint to start a 'FOrum Web Application" or what shoud the best web control to used in this application..
-->if i will ask my team leader to explain it to me well she will get angry if she found out that in our project there are
still no development that im trying to connect to the database, also trying to figure out how to validate password and
username name in a database(well to tell you that in our group,im responsible in coding asp,net)..
-->for those who always help me thank you..i know that im some kind of stupid, i may used my common sense,but i dont still
get it..Im just new at programming asp.net...
-->once again thank you for reading this thread..hope you can give me advice..becuase i dont know what to do..
Im tired thingking
|
|
|
|
|
write the sql query in your login page's code behind file, then use oledb to connect the access database and execute the query
|
|
|
|
|
Dear blitz2bleach,
1. Regarding your Count(*) problem : Just check your MS access editor or what you say MS access Quesry designer you can get the Count function somewhere in Function(s)
2. API is nothing but Application Programming Interface. Just method and properties of class that you can use while developing an appliation.
Thanks,
Arindam D Tewary
|
|
|
|
|
When I run my simple project, I am getting this message below.
"The report you requested requires further information."
What does it mean? If you know, please share it with me!!!
Keep battling!
|
|
|
|
|
I think ur connecting 2 two tables and display the o/p,
so,regarding that,u need some other field also want to tell in that display query...,
Magesh
|
|
|
|
|
1st post so go easy!
coding: aspx web pages in vb.net 2.0
database: sql server express
i would like to set session variable values from a database query and i cant find out how to do it!
the page flow would be something like this:
1) query database using 'SELECT userID, firstName, lastName FROM users WHERE userID = 1'
2) if data is returned:
create userID, firstName and lastName sessions from the database values for those columns.
3) if no data is returned
tell the user an error has occurred.
4) finally display the session values or the error message on the page.
i can find thousands of tutorials on how to bind data to controls (GridView, DataList, Repeater etc) but none telling me how to query the database and set sessions, cookies or page variables...
if anyone can shed some light on this, it'd be great!
thanks out there,
jake
|
|
|
|
|
i've made a bit of progress with this problem.
this works, but i'm *pretty* sure that it's not the right way to do it.
this code 'loops' through all the database returns but in my example, there should be only one row returned.
i also cant figure out how to do a (this is in english not code):
if (dataSet is empty) Then<br />
<br />
set a error message<br />
<br />
Else<br />
<br />
create the sessions<br />
<br />
End If
hmmm, tricky.
this is the code i've put together:
Dim conn As SqlConnection = [con string here]<br />
Dim dsProjects As DataSet = New DataSet()<br />
Dim cmd As SqlDataAdapter = New SqlDataAdapter("SELECT userID, firstName, lastName FROM users WHERE userID = 1", conn)<br />
<br />
cmd.Fill(dsProjects, "tblProjects")<br />
<br />
Dim dr As DataRow<br />
Dim dt As DataTable = dsProjects.Tables("tblProjects")<br />
<br />
For Each dr In dt.Rows<br />
<br />
Session("clientID") = dr("clientID")<br />
Session("clientID") = dr("firstName")<br />
Session("clientID") = dr("lastName")<br />
<br />
Next
what do you reckon out there? am i going about this the right or wrong way?!
cheers,
jake
|
|
|
|